iphone Programming Glossary: blocksize
send RSA public key to iphone and use it to encrypt http://stackoverflow.com/questions/4211484/send-rsa-public-key-to-iphone-and-use-it-to-encrypt trust trustResult SecKeyRef publicKey SecTrustCopyPublicKey trust const char plain_text plainText UTF8String size_t blockSize SecKeyGetBlockSize publicKey NSMutableData collectedCipherData NSMutableData data BOOL success YES size_t cipherBufferSize.. publicKey NSMutableData collectedCipherData NSMutableData data BOOL success YES size_t cipherBufferSize blockSize uint8_t cipherBuffer malloc blockSize int i for i 0 i strlen plain_text i blockSize 11 int j for j 0 j blockSize 11 plain_text.. collectedCipherData NSMutableData data BOOL success YES size_t cipherBufferSize blockSize uint8_t cipherBuffer malloc blockSize int i for i 0 i strlen plain_text i blockSize 11 int j for j 0 j blockSize 11 plain_text i j ' 0' j cipherBuffer j plain_text..
AESCrypt decryption between iOS and PHP http://stackoverflow.com/questions/6461419/aescrypt-decryption-between-ios-and-php decrypt_data data key return mcrypt_decrypt MCRYPT_RIJNDAEL_256 key data MCRYPT_MODE_ECB function unpadPKCS7 data blockSize length strlen data if length 0 first substr data 1 if ord first blockSize for i length 2 i 0 i if ord data i first break.. MCRYPT_MODE_ECB function unpadPKCS7 data blockSize length strlen data if length 0 first substr data 1 if ord first blockSize for i length 2 i 0 i if ord data i first break return substr data 0 i return data function decrypt_string string string..
|