Questions tagged [commoncrypto]

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

209 questions
1
vote
0 answers

Implicit declaration of SecKeyRawVerify?

I've been trying to resolve why I get this warning when using SecKeyRawVerify: implicit declaration of function 'SecKeyRawVerify' I've looked in the CommonCrypto header files, but this does not appear to be there, other than in the open source code…
Earlz
  • 62,085
  • 98
  • 303
  • 499
1
vote
4 answers

Swift sub-modules in Cocoapods

I'm trying to set up the following arrangement of private Cocoapods: PodA depends on PodB which depends on CommonCrypto. CommonCrypto is a dylib that ships with iOS but doesn't have a Swift header module. Within PodB I've created a custom…
Tim
  • 4,560
  • 2
  • 40
  • 64
1
vote
1 answer

SecKeyRawVerify verifies on mac but fails with -9809 on iOS

I need to digitally sign on mac some data and then verify it on iOS. So I generated RSA keypair and certificate for public key in DER format with open ssl (tried generation with SecKeyGeneratePair but then it is harder to import Public key to iOS…
Peter K
  • 438
  • 3
  • 10
1
vote
1 answer

Does Commom Crypto library supports below key encapsulation RFC?

I try to use below RFC algorithm in my app: https://www.rfc-editor.org/rfc/rfc5990 Bouncy Castle for c# and java supports it but I am working on iOS. As I know best tools for cryptography in ios is commoncrypto library. So the question is that…
Husein Behboudi Rad
  • 5,434
  • 11
  • 57
  • 115
1
vote
1 answer

Using CommonCrypto in Swift generates not safe for use in extensions warning

I've created a simple lib to use HMAC digest for Swift called "SweetHMAC". This lib is so simple, basically is a wrapper to CommonHMAC.h in Swift. I can build and deploy any iOS project using SweetHMAC correctly but, seems by some security issue, my…
Jan Cássio
  • 2,076
  • 29
  • 41
1
vote
2 answers

How to use CCHmac in iOS?

I want to generate SHA512 with salt in iOS. I found following snippet to achieve this but I found that CCHmac() function is for mac. -(NSString *)hashString:(NSString *)data withSalt:(NSString *)salt { const char *cKey = [salt…
NSPratik
  • 4,714
  • 7
  • 51
  • 81
1
vote
1 answer

Determine if key is incorrect with CCCrypt kCCOptionPKCS7Padding-Objective C

I am working on incorporating encryption for data stored in my application. I have gotten pretty far in that I am encrypting and decrypting data, my problem is that I cannot seem to force an obvious decryption error when the wrong key is used. My…
Kyle Jurick
  • 244
  • 2
  • 15
1
vote
1 answer

Sign NSData with RSA private key

I am facing an issue which from my side lacks a lot of description in Apples documentation. I need to sign NSData with RSA private key which is provided from backoffice. Private key is received in form of string. How to achieve this? I do not want…
1
vote
0 answers

RSA public key format for CommonCrypto (iOS)

I'm trying to import a public key from my python server into an iOS keychain. I receive the key from my server as an NSData object. I'm using the addPeerPublicKey:keyBits: function from Apple's Crypto example to convert the NSData into a SecKeyRef,…
Dash
  • 17,188
  • 6
  • 48
  • 49
1
vote
1 answer

Public Key exchange between iOS and Java

I would like to share a public key generated on an iPhone/iPad with an Java based Server or an Android device. On the Java side (Server or Android) I would like to use java.security and libcommonCrypto (the SecKeyRef stuff) on iOS. I've got…
miho
  • 11,765
  • 7
  • 42
  • 85
1
vote
1 answer

Extract subdata from NSData without copying

I have the following situation: there is a NSData that i need to decrypt. The data consists of: fixed length file header encrypted content I'm using CCCrypt for decryption, but it probably doesn't matter, because this is more of an NSData related…
Marius
  • 3,976
  • 5
  • 37
  • 52
1
vote
0 answers

AES128 encryption giving different results in iOS 6 & iOS 7

Well, I'm working on an app that sends and receives encrypted data from a web server. The issue here, is that, my encryption results were different. Now, comparing the result running on iOS6 & iOS 7 simulator, I noticed the hex was different too,…
Die n' Go
  • 21
  • 1
1
vote
1 answer

Obj-C: In CommonCrypto, if the CCCrypt() do not use option kCCOptionPKCS7Padding, the result buffer is empty

If I remove the kCCOptionPKCS7Padding, the following function will return me correct buffer size with empty cipher data <>. I can't use kCCDecrypt option to decrypt empty cipher text back to Plain text. char keyPtr[kCCKeySizeAES128 + 1]; …
Yi Jiang
  • 3,938
  • 6
  • 30
  • 62
1
vote
1 answer

Decrypting AES256 strings from NSString NOT NSData

I am trying to work with AES256 to send and receive strings from an iPhone app to server and back. Using the following I can successfully encrypt a string and decrypt a string with the following code:- // Encryption Methods NSString…
Will Roberts
  • 309
  • 3
  • 12
1
vote
0 answers

objective c aes 128 encryption for a c# web service

So I'm trying to figure out how to make an objective c version of this as it's part of a wcf service security that was implemented. My main issue here is Idk where to begin as some articles/tutorials would automatically pad 0 in the beginning (not…
gdubs
  • 2,724
  • 9
  • 55
  • 102