kolombet / as3crypto

Automatically exported from code.google.com/p/as3crypto
1 stars 0 forks source link

bug in decrypting #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
by importing the follwoing:
    import com.hurlant.crypto.symmetric.ICipher;
    import com.hurlant.crypto.symmetric.IVMode;
    import com.hurlant.crypto.symmetric.IMode;
    import com.hurlant.crypto.symmetric.NullPad;
    import com.hurlant.crypto.symmetric.PKCS5;
    import com.hurlant.crypto.symmetric.IPad;
    import com.hurlant.util.Base64;
    import com.hurlant.util.Hex;
    import com.hurlant.crypto.Crypto;

I'm using this to send some variables to a PHP file and then recive the 
results from php like this:

echo 'currName='.$myEncrypt->encrypt($currName).

the encryption key I'm using is "UYHGVREQ"

and I'm decrypting the string from php like this:
decrypt(vars.currName)

imagine that the value of $currName from the php file is "Peter" just for 
an example, ok? it works, just good, just perfect but when accidentaly I 
changed the name to "Rashid", it didn't work!!!

I checked the encrypted string and found "GM+rR8hJp54=" without qutations. 
and that makes the problem and the following error occures in flash:

Error: PKCS#5:unpad: Invalid padding value. expected [103], found [8]
    at com.hurlant.crypto.symmetric::PKCS5/unpad()
    at com.hurlant.crypto.symmetric::ECBMode/decrypt()
    at App/decrypt()
    at App/backResults()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

What is the expected output? What do you see instead?
explained above.

What version of the product are you using? On what operating system?
As3 Crypto Library - 1.3

Please provide any additional information below.

Original issue reported on code.google.com by taha...@gmail.com on 7 Nov 2009 at 7:03

GoogleCodeExporter commented 9 years ago
It may be worth checking out this 
http://ria101.wordpress.com/2010/06/04/as3crypto-rsa-padding-function-
returned-null-bug-of-death-fix/

Original comment by thedwill...@gmail.com on 4 Jun 2010 at 4:26