DES Cipher

Matthew Seaman m.seaman at
Wed Dec 22 14:32:08 UTC 2010

On 22/12/2010 14:20, Mohammad Hedayati wrote:
> Can anyone please show me a sample code for ciphering using DES in FreeBSD?

To encrypt, something like:

   openssl enc -e -des -in plaintext.txt -a -out encrypted.asc

Decrypt like so:

   openssl enc -d -dex -in encrypted.asc -a -out plaintext.txt

Note: completely untested.  You may well need to supply various extra
arguments to make it all work.  See 'openssl enc help' for hints.

Note 2: DES is pretty trivial to crack nowadays.  Don't use this for
anything serious.  You can encrypt using AES or any of a host of other
ciphers by using a very similar openssl command line.

Note 3: If you're actually after DES "encrypted" passwords, then see
crypt(3).  From the commandline you can use the Perl crypt function:
'perldoc -f crypt' for details.



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
JID: matthew at               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-questions mailing list