Questions tagged [commoncrypto]

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

209 questions
5
votes
0 answers

Decryption using CCCrypt returns kCCSuccess with bad buffer length

I have an encrypted data stream (AES 128, CBC, PKCS7) that I'm trying to decrypt as it arrives. Occasionally I'll get a packet of length 334, which I then try to decrypt. When I do this on an iPhone 5, it returns kCCBufferTooSmall (which is expected…
thegrinner
  • 11,546
  • 5
  • 41
  • 64
5
votes
2 answers

CCKeyDerivationPBKDF on iOS5

I'm trying to write a password encryption function into my app, following this article. I wrote a function that runs the CCCalibratePBKDF function and outputs the number of rounds. const uint32_t oneSecond = 1000; uint rounds =…
Fogmeister
  • 76,236
  • 42
  • 207
  • 306
5
votes
1 answer

Replace OpenSSL dependence with Common Crypto? (Mac App Store Receipt Validation)

My understanding is that OpenSSL is deprecated in OSX 10.7 in favor of Common Crypto, but I can't seem to get a good handle on how to transition from OpenSSL code to Common Crypto code. In particular, I'm looking at App Store receipt validation…
Isaac
  • 10,668
  • 5
  • 59
  • 68
5
votes
0 answers

SecKeyGetBlockSize or SecKeyRawVerify for Public Key throw EXC_BAD_ACCESS code=2

Upon trying to implement Security.Framework SecKeyRawVerify iOS function from Apple's example, programm halts with bad pointer error (EXC_BAD_ACCESS code=2). Any help or suggestions would be appreciated. Here is my code: -…
EZer0
  • 61
  • 1
  • 3
4
votes
1 answer

iPhone Public-Key Encryption SecKeyEncrypt returns error 9809 (errSSLCrypto)

I am trying to use the iPhone's PKI libraries to encrypt a short string (12345678), but I keep getting the error -9809 (i.e. errSSLCrypto) whenever I try to use SecKeyEncrypt. The SecureTransport.h header file describes this error simply as…
futureelite7
  • 11,462
  • 10
  • 53
  • 87
4
votes
1 answer

Swift - Cannot convert value of type 'UnsafePointer' to expected argument type 'UnsafePointer<_>'

I am trying to use CommonCrypto (with the help of https://github.com/sergejp/CommonCrypto) for the first time with swift. Here is my code: UnsafeRawPointer(ivData!.withUnsafeBytes {(pointer) -> UnsafePointer in let ivBuffer =…
ewizard
  • 2,801
  • 4
  • 52
  • 110
4
votes
1 answer

cURL error 58: SSL: Can't load the certificate "..." and its private key: OSStatus -25299 on Mac

The code is working fine on Ubuntu vagrant box, but on local MacOs it does not load sertificates saying cURL error 58: SSL: Can't load the certificate "..." and its private key: OSStatus -25299 I researched that Mac has a point of supporting the…
Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191
4
votes
2 answers

Where can I get CommonCrypto / CommonCrypto file from?

I have a problem with importing CommonCrypto/CommonCrypto or CommonCrypto/CommonDigest. I need a SHA256 for my Swift code. I found CommonCrypto github site in Cocoapods. https://github.com/AlanQuatermain/aqtoolkit So I have downloaded the file from…
kimpro
  • 329
  • 1
  • 5
  • 13
4
votes
2 answers

how to use SHA256 with salt(some key) in swift

I found we can hash some string with CommonCrypto. and I see some examples but they don't use salt. how can i use the SHA256 with salt?
kimpro
  • 329
  • 1
  • 5
  • 13
4
votes
2 answers

How to send CommonCrypto POST request using AES Crypto in Objective c?

I just try to send secure request from iOS app to php platform web services in objective c. I trying since 2 days but i did not find the logic or anything how to achieve this: Following is a Swift Code that using CryptoSwift Framework func…
Nitin Gohel
  • 49,482
  • 17
  • 105
  • 144
4
votes
1 answer

AES 256 with PKCS7 padding encoded data have half ECB and half CBC block

Im trying to decode data in php returned from server: I know data AES 256 decoded and have PKCS7 padding but cant figure out which block mode it use here is my php function: public function decode($data) { //AES decode $iv =…
Harry
  • 63
  • 4
4
votes
3 answers

Issue decrypting with CommonCrypto in Swift

I am working in a Swift-only crypt/decrypt Extension for String and NSData, and the crypt part is working based in the answer provided by @Zaph in the linked question: Issue using CCCrypt (CommonCrypt) in Swift The crypt output was tested using the…
eharo2
  • 2,553
  • 1
  • 29
  • 39
4
votes
2 answers

How to encrypt in node.js and decrypt with RNCryptor

I'm having trouble encrypting data with node and decrypting with RNCryptor. My understanding is that RNCryptor uses a special data format? The cryptotext is being generated as follows: var crypto = require('crypto'); var cipher =…
Jack Rogers
  • 305
  • 3
  • 14
4
votes
1 answer

Data encryption with AES

I'm building an app that will communicate with a server (php), and this communication (probably will be with json) i want to encrypt. After a lot of searching and reading i found the AESCrypt-Objc project. While testing the encryption (i'm using a…
YYfim
  • 1,402
  • 1
  • 9
  • 24
4
votes
0 answers

CommonCrypto works differently in IPA archive than in debugger

I've been pulling my hair out over this one. I'm using CommonCrypto in my iOS application to encrypt data which I then send to a Windows server which decrypts it. This works perfectly in the Xcode (latest version) development environment both on my…
hocker
  • 688
  • 6
  • 18
1 2
3
13 14