Jimmy-Dinis / crypto-js

crypto-js
0 stars 0 forks source link

padding schemes corrupted - ZeroPadding #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
/*** encrypt */ 
var ciphertext = Crypto.AES.encrypt(plaintext , "Secret Passphrase", 
{ mode: new Crypto.mode.OFB(Crypto.pad.ZeroPadding) }); 

2.
/*** decrypt */ 
var plain = Crypto.AES.decrypt(ciphertext, "Secret Passphrase", 
{ mode: new Crypto.mode.OFB(Crypto.pad.ZeroPadding) }); 

What is the expected output? 

// encrypt
ciphertext = "SwcOSeXEGMIQUKEn7ibuoV28KfNXBPH3tngp3ORySr0=";
// decrypt
plaintext = "plaintext";        // this is 9 bytes

What do you see instead?
plaintext = "plaintext???????"; // this is 16 bytes

What version of the product are you using? 
*crypto-js v2.4.0
*crypto-js v2.5.2
*crypto-js v2.5.3

On what operating system?
SO: Windows 7 - 32 bit
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20100101 
Firefox/10.0.2

Please provide any additional information below.
The ZeroPadding should be fixed now in release 2.5.4 and in the latest 3.x 
release. 

Original issue reported on code.google.com by MicheleR...@gmail.com on 30 May 2012 at 8:22

GoogleCodeExporter commented 9 years ago

Original comment by Jeff.Mott.OR on 30 May 2012 at 8:50