Questions tagged [commoncrypto]

Apple's cryptography framework. Contains functions for generating commonly-used hashes and cryptographic functions.

209 questions
1
vote
1 answer

AES interoperability of iOS and Java with CTR mode

I have encrypted a message with CTR mode in Java, and am trying to decrypt the message in iOS. However, my test program scrambles the last block when decrypted The code is as follows: + (NSData *)doCipher:(NSData *)data key:(NSData *)symmetricKey…
user1735096
  • 183
  • 1
  • 2
  • 8
1
vote
2 answers

Is there a compatibility mode provided by OS X CommonCrypto for OpenSSL EVP_* calls (like there is for OpenSSL MD5 functions)?

Compiling one of my source files on Mac OS X10.7 and getting these deprecation warnings: xxx_evp.c:135:5: 'EVP_MD_CTX_init' is deprecated xxx_evp.c:137:9: 'EVP_DigestInit_ex' is deprecated xxx_evp.c:177:9: 'EVP_DigestUpdate' is…
Chris Markle
  • 2,076
  • 4
  • 25
  • 46
1
vote
1 answer

AES/CFB8 cipher on iOS

I am trying to implement an AES/CFB8 streaming cipher on iOS. I believe that the way to accomplish this is to use the CommonCrypto library provided by Apple. All of the little documentation I have found only shows block ciphers, so how would one…
magmastonealex
  • 426
  • 4
  • 16
1
vote
1 answer

Replacing OpenSSL with native OSX Library

In our existing application, which is tightly coupled with the OpenSSL, we would like to make use of an OSX native crypto library. Related to this I have following questions: I believe OpenSSL does two jobs, one make the Transport layer secure, and…
Amitg2k12
  • 3,765
  • 10
  • 48
  • 97
1
vote
1 answer

CCCrypt decryption results in -4304

When I encrypt a string then immediately decrypt, the CCCryptorStatus is -4304 and the resultant decoded string is not the proper length. Can anyone see what I might be doing wrong? //Encrypt NSString *plainText =…
skajake
  • 438
  • 1
  • 6
  • 12
1
vote
1 answer

I don't know how to md5 my password in iPhone ,or how to start

I don't know how to md5 my password in iPhone ,or how to start. I tried to know something like CommonCrypto.Will help? urgely for a suggestion~ thanks~
anna
  • 662
  • 5
  • 28
0
votes
2 answers

How to compile and use CommonCrypto for iOS 4?

Since CCKeyDerivationPBKDF is not available until after iOS 5.0, people have suggested using the open source code for CommonCrypto available here: http://www.opensource.apple.com/source/CommonCrypto/CommonCrypto-55010/ My question is - how does one…
Raj Lalwani
  • 83
  • 1
  • 5
0
votes
1 answer

Confusion about Encryption in iOS

I'm a very newb programmer trying to write some iOS programs, and when I reached the part where I must encrypt my data, I ran into a misty and ill-documented wall. Apple apparently provides all the tools one needs to encrypt data but doesn't write…
Serendipity
  • 2,001
  • 2
  • 13
  • 12
0
votes
1 answer

I keep getting the wrong values for my PBKDF2 implementation

I'm trying to implement PBKDF2 and I keep getting the wrong result, not sure what the problem is... I'm using the common crypto implementation to check my results here is my test function #include #include "PBKDF2.h" #include…
AnthonyM
  • 1,115
  • 2
  • 10
  • 20
0
votes
1 answer

how to resolve CommonKeyDerivation.h: no such file found error

I am encrypting a string and use #import CommonCrypto/CommonKeyDerivation.h but xcode show error no such file found though I add security framework and I also use #import CommonCrypto/CommonCryptor.h but it shows no error. I found file in openSource…
Soniya
  • 600
  • 7
  • 34
0
votes
0 answers

Using CommonCrypto for 3DES authentication with mifare DESFire card using Core NFC and Swift

I'm trying to write an app which reads a value from a mifare DESFire card. I'm using Swift and Core NFC and have managed to successfully connect to the card. I've also managed to send a mifare command to select the relevant application. However, I'm…
0
votes
0 answers

how to decode and decrypt a string in swift

From a server, I get an encrypted and base 64 encoded string, these are criteria used to encrypt it. aes 256 cbc encryption system with hexadecimal digest the key is hash sha 512 of a phone number the first 32 characters are the key, the last 16…
0
votes
1 answer

How does the IV is getting prefixed in the CommonCrypto Objective-C aes?

I am implementing the AES/CBC encryption using the CommonCrypto library for Objective C code base and i found a code as answered by Zaph in which he recommends to prefix the IV with the encrypted text which we receive at the end of CommonCrypto's…
user16780334
  • 422
  • 5
  • 20
0
votes
0 answers

How to use swift CommonCrypto to implement AES-CTR decryption in swift

I'm on iOS and trying to match the Android AES-CTR decryption. The code on Android: Cipher cipher = Cipher.getInstance("AES/CTR/NoPadding"); cipher.init( Cipher.DECRYPT_MODE, key, new IvParameterSpec(ivStr)); result = …
RobotX
  • 208
  • 2
  • 15
0
votes
0 answers

Is there an iOS alternative to openssl's EVP_BytesToKey?

I want to make an AES 256 CBC key and iv with SHA1 digest like in openssl's EVP_BytesToKey function, but with iOS tools. Is there an iOS alternative for that? In openssl it looks like: int ret = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), salt,…
arunna
  • 1
  • 4