ideawu / Objective-C-RSA

Doing RSA encryption and decryption with Objective-C on iOS
http://www.ideawu.com/blog/post/132.html
Other
1.15k stars 280 forks source link

Can not decrypt #41

Open veila opened 7 years ago

veila commented 7 years ago

I created public key and private key by command line like in website https://rietta.com/blog/2012/01/27/openssl-generating-rsa-key-from-command/ It encrypt with public key very good but decWithPrivKey always empty. Pls help me. Tks

NineCity commented 6 years ago

I encountered the same problem. Who knows the reason? help me, thank you

btnguyen2k commented 6 years ago

If encryption was good then normally you are good. Wierd result usually comes from env or security settings. I suggest you post your code along with your keys (if they are just temp keys, nothing sensitive) and info of your development env (Xcode version, Mac version, Emulator version, etc).

Cheers,

dunno7 commented 2 years ago

solved, follow the solution you provided: comment "data = [RSA stripPrivateKeyHeader:data];". Thanks a lot for your answer. 👍