Sunday, August 9, 2009

openssl command-line program

The openssl command can be used to create digests of a file, which can be used to verify that a file has not been tampered with:

$ echo "test file"> foo.txt

$ openssl dgst -md5 foo.txt

MD5(foo.txt)= b05403212c66bdc8ccc597fedf6cd5fe
$ openssl dgst -sha1 foo.txt

SHA1(foo.txt)= 0181d93fee60b818e3f92e470ea97a2aff4ca56a

To view the other message digests that can be used, look at the output of openssl list-message-digest-commands.

You can also use openssl to encrypt files. To view the list of available ciphers, use openssl list-cipher-commands. Once you’ve chosen a cipher to use, you can encrypt the file using the following commands:
$ openssl enc -aes-256-cbc -salt -in foo.txt -out foo.enc

enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:
$ file foo.enc

foo.enc: data
$ cat foo.enc

Salted__yvi{!e????i"Yt?;(Ѱ e%
$ openssl enc -d -aes-256-cbc -in foo.enc

enter aes-256-cbc decryption password:
test file

In the above example, the file foo.txt was encrypted using 256-bit AES in CBC mode, the encrypted copy being saved as the file foo.enc. Looking at the contents of the file provide gibberish. Decrypting the file is done using the -d option, however keep in mind that not only do you need to remember the password, you also need to know the cipher used.

I hope it will help You :)


Anonymous said...

Thats good buddy
keep it up .

Khush Dil Khan said...

Thats good buddy
keep it up

ninest123 said...

replica watches, ugg boots, ralph lauren pas cher, oakley sunglasses, louis vuitton, nike roshe run, chanel handbags, burberry, kate spade outlet, louis vuitton outlet, nike outlet, longchamp, louboutin shoes, gucci outlet, ray ban sunglasses, air jordan pas cher, nike free, jordan shoes, sac longchamp, uggs on sale, louboutin, nike free, cheap oakley sunglasses, nike air max, prada outlet, air max, christian louboutin outlet, tory burch outlet, longchamp pas cher, polo ralph lauren outlet, ugg boots, polo ralph lauren outlet, louis vuitton, replica watches, nike air max, louboutin pas cher, oakley sunglasses, tiffany jewelry, oakley sunglasses, ray ban sunglasses, louis vuitton, prada handbags, michael kors, ray ban sunglasses, louis vuitton outlet, louboutin outlet, longchamp outlet, oakley sunglasses, longchamp outlet, tiffany and co

ninest123 said...

michael kors, hermes, michael kors outlet, converse pas cher, vans pas cher, true religion jeans, michael kors, nike roshe, tn pas cher, michael kors outlet, michael kors outlet, michael kors outlet, north face, nike air max, mulberry, coach outlet, nike air max, ugg boots, nike free run uk, north face, replica handbags, nike air max, sac guess, michael kors outlet, lululemon, true religion jeans, abercrombie and fitch, nike blazer, hollister pas cher, michael kors, new balance pas cher, hogan, oakley pas cher, kate spade handbags, true religion outlet, coach outlet, air force, burberry outlet online, vanessa bruno, ugg boots, timberland, ray ban pas cher, true religion jeans, coach purses, lacoste pas cher, hollister, burberry, ralph lauren uk, ray ban uk, michael kors

ninest123 said...

vans shoes, beats by dre, ghd, lancel, herve leger, new balance, ray ban, ralph lauren, abercrombie and fitch, celine handbags, north face outlet, birkin bag, louboutin, chi flat iron, soccer jerseys, nike air max, ferragamo shoes, mont blanc, insanity workout, hollister, jimmy choo shoes, nfl jerseys, soccer shoes, nike huarache, nike air max, nike roshe, wedding dresses, instyler, iphone cases, p90x workout, timberland boots, reebok shoes, mcm handbags, gucci, oakley, hollister, asics running shoes, valentino shoes, longchamp, converse, vans, converse outlet, baseball bats, hollister, north face outlet, bottega veneta, lululemon, babyliss, mac cosmetics, nike trainers

ninest123 said...

bottes ugg, ugg boots uk, ugg,uggs,uggs canada, canada goose uk, canada goose outlet, pandora jewelry, moncler, hollister, marc jacobs, swarovski, juicy couture outlet, replica watches, canada goose, moncler, swarovski crystal, links of london, wedding dresses, moncler outlet, thomas sabo, karen millen, pandora jewelry, moncler, montre pas cher, juicy couture outlet, ugg pas cher, louis vuitton, moncler, moncler, louis vuitton, moncler, louis vuitton, supra shoes, coach outlet, canada goose, toms shoes, ugg,ugg australia,ugg italia, moncler, doudoune canada goose, canada goose, canada goose outlet, louis vuitton, pandora charms, canada goose, sac louis vuitton pas cher, pandora charms