ios - Decrypt Encrypted value -
in application using aes encryption , decryption encrypt , decrypt value.when trying decrypt encrypted value, result showing nil value. commented code encrypted encrypted value can set on nsstring [ secretmessage ] , send decryption.
nsstring *salt_value = @"0{��\\n;s�i�s��b~"; nsdata *saltvalue = [salt_value datausingencoding:nsutf8stringencoding]; nsdata *key = [bbaes keybysaltingpassword:@"password" salt:saltvalue keysize:bbaeskeysize256 numberofiterations:65536]; nsstring *data = @"/r/mkthb1y/bczlvhfm8xw=="; nsdata *pngdata = [[nsdata alloc] initwithbase64encodedstring:data options:1]; nsstring *secretmessage = @"9buc9wl1o4m8a3qbsdjvsjek4hzxjmn9t57mpo/1uro="; // // nsstring *encryptedstring = [secretmessage bb_aesencryptedstringforiv:pngdata key:key options:bbaesencryptionoptionsincludeiv]; // nslog(@"encrypted message: %@", encryptedstring); nsstring *decryptedmessage = [secretmessage bb_aesdecryptedstringforiv:pngdata key:key]; nslog(@"decrypted message: %@", decryptedmessage); any or advice appreciated.
follow link https://github.com/gurpartap/aescrypt-objc , use library. https://github.com/scottyab/aescrypt-android android. encrypt , send data each other. reservation have iv static while there didn't appear salt. starting point , own secretkeyspec , iv can provided.
Comments
Post a Comment