haxe-crypto
haxe-crypto copied to clipboard
BlowFish encrypt issue
in encrypt method we need to encrypt all blocks, so: public function encrypt(block:ByteArray, index:Int32 = 0):Void { var count:Int = block.length >>> 3; var i:Int = 0; for (i in 0...count) encryptBlock(block, 8 * i, block, 8 * i); }
same for decrypt: public function decrypt(block:ByteArray, index:Int32 = 0):Void { var count:Int = block.length >>> 3; var i:Int = 0;
for (i in 0...count)
decryptBlock(block, 8 * i, block, 8 * i);
}
Please, do a PR so I can merge it. You should remove index argument then. Also create a test here that checks the right behaviour: https://github.com/soywiz/haxe-crypto/blob/master/test/com/hurlant/tests/crypto/symmetric/BlowFishKeyTest.hx