Decrypting Value From A Key
Aug 30, 2014I got a the key: "HK8N99LQ"
and the Value:
"THBiUURtaHdCSDlFRWYva1VSRm5QUCtWN2NnditldVE2RnhEa zdLNHlwZEZZQnlxU0xDQ3Zlc1ZrV1RNNHgyamcyNXgvUFUxQk1 UQVpPLzJTVDZnR3ZIUTZLbjRoemo4aU9ORVdKZ21kdktjOEZqZ UM0bkwvd29hbWM3bXQ2cXcvbjZRaUdtZDU5ZWtUSlFMZm1DUHZ aL284OGdqd1JJTGNvQzczb1dISTNScFhSc3VDemRRVTM2bmNic lM4b2FuTWM5RUE2UnUvL1RoT0tSOGFScDltSHZaY2R2MHNQS2x COGZOOUkzazcvVmtCZ2FpTnNwZ3p4aGVBWkJtUWJzN1M2YnAyM DJvMXFUMHdCYk9MUG5vNUNOaEtrVTZCZ2RJWTh3dzNqMDR6VVk vMTNNUW0reGtrUT090"
from [URL] ....
to decrypt the code in c# the website provide this code:
public static string Decrypt(string app_token, string signed_request) {
byte[] keyArray;
//get the byte code of the string
byte[] toEncryptArray = Convert.FromBase64String(signed_request);
// app token
string key = app_token;
[Code] .....
But how I decrypt it in Java, I tried to use that code but I got error message:
public String Decrypt(String signed_request) {
String decryptedString = null;
try {
// Generate the secret key specs.
byte[] key = "HK8N99LQ".getBytes();
[Code] ....
Error Message:
Input length must be multiple of 16 when decrypting with padded cipher.