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.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: [email protected] Kent, CT11 9PW
signature.asc
Description: OpenPGP digital signature
