I’m trying to decrypt it in Xcode with AES-Crypt-Objc. I’have tried really everything..different libariers and so on..
..anyhting goes wrong, but I don’t know what pls. help…
UPDATE (another opinion)
Now i try this:
function mc_encrypt($encrypt, $key = "12345678901234567890123456789012")
{
$encrypt = "Affe";
$iv2 = '';
for($i=0;$i<16;$i++){ $iv2 .= "\0"; }
$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, ($encrypt), MCRYPT_MODE_CBC,$iv2);
$encode= base64_encode($ciphertext);
return $encode;
}
in Obj-C I use also the same framework (still IV is now nil)
…still nothing works…
AND some Objc-C Code:
note: request responseString is the string comes from above.
NSString *key = @"12345678901234561234567890123456";
NSLog(@"decrypted: %@",[AESCrypt decrypt:[request responseString] password:key]);
output is sometimes nothing, sometimes null.
For most systems, encryption should be non-deterministic — encrypting the same plaintext twice should almost never give the same ciphertext. Why? Let’s say you send “attack at dawn” at midnight on day 0 to your accomplice, the attack fails (but you get away unharmed), and at midnight on day 1 you send “attack at dawn” again…
Apart from that, let me count the ways:
mcrypthandles overlong keys; the ObjC code adds zero-padding inFixKeyLengths().FWIW, I’ve seen that that (or similar) ObjC code all over the place. I can’t un-recommend it enough; it really isn’t suitable for general usage.
Just Use HTTPS.