You need to sign in to do that
Don't have an account?
Unable to decrypt the userName and Password pass from URL .
Hi folks,
I am passing my username thrugh url using encrption.But during fetching of url(from second page) it is unable to decrpt username.Please help me on this.Follow the below code which aceess the "https://c.ap1.visual.force.com/apex/MySecondPage?username=r+6QYqHGBsbrkKDopBSy6i3v2JykazW2+C4YBSoK5Z4%3D" url from second page.
public String Valueone{get;set;}
Valueone = ApexPages.currentPage().getParameters().get('username');
Blob b64dcrypted = EncodingUtil.base64Decode(Valueone);
Blob cryptoKey = Crypto.generateAesKey(128);
Blob decryptedData = Crypto.decryptWithManagedIV('AES128', cryptoKey, b64dcrypted);
System.debug('>>>>>>>>>>>>>>>>>>>>>>>>>>>>' + decryptedData.toString() );
this codd shows me the following message.(Even I have pass algorithmName as AES128,AES192,AES256 but facing same problem)
System.SecurityException: Input length must be multiple of 16 when decrypting with padded cipher .
Regards,
Itsaws11
Thanks for your quick reply.I have to pass username(encrypt) and password(Encrypt) thrugh url.which should be decrpyt in constructor of my second page.
Regards
Itsaws11