* HASH 遊び [#bc41be9f] ** sha1 [#n0299a00] php -r 'echo sha1("engineering");' echo -n 'engineering' | perl -lne 'use Digest::SHA1 qw(sha1_hex); print sha1_hex("$_")' perl -le 'use Digest::SHA1 qw(sha1_hex); print sha1_hex("engineering");' echo -n 'engineering' | openssl dgst -sha1 --- 72917ef6c1d976fb7d5e3e52394a829d441ed3cd ** md5 [#a1f769f3] php -r 'echo md5("engineering");' echo -n 'engineering' | perl -lne 'use Digest::MD5 qw(md5_hex); print md5_hex("$_")' perl -le 'use Digest::MD5 qw(md5_hex); print md5_hex("engineering");' echo -n 'engineering'| openssl dgst -md5 --- 5d554bc5f3d2cd182cdd0952b1fb87ca ** base64 [#n461e6fd] $ echo engineering |base64 ZW5naW5lZXJpbmcK $ echo ZW5naW5lZXJpbmcK |base64 -d engineering $ echo http://tomocha.net/ | base64 aHR0cDovL3RvbW9jaGEubmV0Lwo= $ echo aHR0cDovL3RvbW9jaGEubmV0Lwo= |base64 -d http://tomocha.net/ ** hex [#j826bff3] echo -n 'engineering' | perl -lne 'print unpack("H*", $_)' perl -le 'print unpack("H*","engineering");' --- 656e67696e656572696e67 逆 echo '656e67696e656572696e67' | perl -lne 'print pack("H*", $_)' perl -le 'print pack("H*", "656e67696e656572696e67")' その他 - [[Linux/hexへの変換方法]] * デコード(というよりCrack) [#d938c905] - http://passcracking.com/ - http://www.cmd5.org/ - http://www.freerainbowtables.com/ - http://rainbowtables.shmoo.com/ - http://lastbit.com/md5password/default.asp - http://www.stottmeister.com/blog/2009/04/14/how-to-crack-md5-passwords/ - http://bogus.jp/pukiwiki/index.php?%A5%D1%A5%B9%A5%AF%A5%E9%A5%C3%A5%AF * OpenSSL をつかう。 [#g68f7949] openssl には次のアルゴリズムが対応している。 options are -c to output the digest with separating colons -d to output debug info -hex output as hex dump -binary output in binary form -sign file sign digest using private key in file -verify file verify a signature using public key in file -prverify file verify a signature using private key in file -keyform arg key file format (PEM or ENGINE) -signature file signature to verify -binary output in binary form -engine e use engine e, possibly a hardware device. -md5 to use the md5 message digest algorithm (default) -md4 to use the md4 message digest algorithm -md2 to use the md2 message digest algorithm -sha1 to use the sha1 message digest algorithm -sha to use the sha message digest algorithm -sha224 to use the sha224 message digest algorithm -sha256 to use the sha256 message digest algorithm -sha384 to use the sha384 message digest algorithm -sha512 to use the sha512 message digest algorithm -mdc2 to use the mdc2 message digest algorithm -ripemd160 to use the ripemd160 message digest algorithm 使い方は簡単。 # echo -n 'engineering' | openssl dgst <algorithm>