23 July 2010

encrypt/decrypt with openssl

# echo "hi there" > test
# openssl aes-128-cbc -in test -base64 -k password
U2FsdGVkX18mc7Sq6Q3CqPVbNe3Kp7Pyqr2sDo7rQTE=

# openssl aes-128-cbc -in test -base64 -k password > test.enc
# openssl enc -d -in test.enc -k password
U2FsdGVkX18z0h1BxcQtiQ7Fq7xKnabTC8fZnmw1bOE=

# openssl aes-128-cbc -d -in test.enc -k password -base64
hi there
# echo -n "" | md5sum
d41d8cd98f00b204e9800998ecf8427e
# echo -n "hi there" | md5sum
fd33e2e8ad3cb1bdd3ea8f5633fcf5c7

Reference:
http://www.cs.colorado.edu/~jrblack/class/csci6268/f05/slides/CSCI6268L12.ppt
http://www.mydigitallife.info/2008/12/10/how-to-calculate-and-generate-md5-hash-value-in-linux-and-unix-with-md5sum

No comments:

Post a Comment