[Bcrypt-users] bcrypt file format?
Status: Beta
Brought to you by:
jwshelley
From: Dossy S. <do...@pa...> - 2009-10-29 20:18:32
|
Hi, I'm trying to use PHP and Mcrypt to decrypt a file that has been encrypted using bcrypt 1.1. I've modified bcrypt to dump the 448-bit key it has generated and am using this snippet to try and decrypt the payload, which is simply the LICENSE file from bcrypt, encrypted without compression using the same "eggheads" key. <?php /* * Bcrypt uses a 56-byte (448-bit) key. */ $key = pack("H*", "1E8CD6418B373C741C415CF5F0E482476C66B1FDC3E37EEEFE7C8C704D9139A9A4CA24B53858A261C59F4F94383F9046D38E16A9E21BB242"); // $key = pack("H*", "85071DE15C3282516DD6B725BD7A1511B6639928BE1D4F99E54DF3FC4C811E48038FDE1669CAA017516FA502785B8D020616F26A61CCB39D"); $td = mcrypt_module_open(MCRYPT_BLOWFISH, '', 'ecb', ''); $iv = '00000000'; mcrypt_generic_init($td, $key, $iv); $plaintext = mdecrypt_generic($td, file_get_contents("uncompressed.bfe")); mcrypt_generic_deinit($td); mcrypt_module_close($td); var_dump($plaintext); ?> Yet, this doesn't yield the plaintext. What's the trick? What is bcrypt actually doing? -- Dossy Shiobara | do...@pa... | http://dossy.org/ Panoptic Computer Network | http://panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70) |