Bug 149412 - bdes(1) in CFB/OFB modes can't decrypt own output
Summary: bdes(1) in CFB/OFB modes can't decrypt own output
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-08 08:20 UTC by Alan Hughes
Modified: 2017-12-31 22:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Hughes 2010-08-08 08:20:04 UTC
encrypted output from bdes on CFB or OFB modes does not decrypt with bdes. For some combinations of plaintext/key/mode/length decryption dumps core, all others merely fail 'nicely'.
CBC(default) and ECB modes are unaffected.
labeled non-critical/low-priority as these would be rarely used modes.

Fix: 

don't use CFB or OFB modes.
How-To-Repeat: opt='-f 64 -k $key' ;key=0x$(md5 -qs "testpass") ;echo "plaintext for testing bdes" |bdes $opt |bdes -d $opt

replacing "-f 64" with -F or -o and other suitable length
Comment 1 Remko Lodder freebsd_committer freebsd_triage 2010-08-29 15:13:37 UTC
Responsible Changed
From-To: freebsd-bugs->secteam

For review/check to secteam
Comment 2 Remko Lodder freebsd_committer freebsd_triage 2013-08-01 21:24:42 UTC
Responsible Changed
From-To: secteam->cperciva

Hi Colin, as one of our crypto experts, you might want to chime in on this one?
Comment 3 Remko Lodder freebsd_committer freebsd_triage 2013-08-09 08:41:13 UTC
Responsible Changed
From-To: cperciva->freebsd-bugs

This is not something -secteam related so throw it back in the pool. 

One of the questions that passed me is that why would someone do this 
when openssl is capable of doing the same?
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:24 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped