Questions tagged [commoncrypto]

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

209 questions
0
votes
1 answer

Cannot convert value of type 'UnsafeRawBufferPointer' to expected argument type 'UnsafeMutableRawPointer?'

I was followed this answer to encrypt the data. The encryption is success. But I am stuck with the decrypting the data. I've lot of datas are encrypted. But I used another answers for decryption and decrypted data is not as original. I tried to…
user19263191
0
votes
1 answer

How to decrypt in swift using CommonCrypto

I am building an IOS app and it communicates with the JS. So the communication between the two ends must be encrypted. So my main intention is to encrypt from Javascript side and send it to the IOS app mobile end, and the mobile app should decrypt…
SVG
  • 809
  • 6
  • 21
0
votes
1 answer

How can I convert this encryption function from Swift to Objective-C?

I'm writing a helper function for an iOS Objective-C app that is supposed to encrypt a string with the provided key using the AES-128 algorithm. I already have a working implementation of this function in Swift, but I'm struggling translating it…
Andrea Corsini
  • 197
  • 1
  • 9
0
votes
1 answer

Swift AES Common crypto - First 16 characters during AES decryption gets omitted

Trying to perform encryption and decryption using AES ( common crypto ) in swift, For some reason while decrypting the first 16 characters are getting trimmed off. Can anyone please look at the below playground code and suggest what could be going…
Max
  • 5,380
  • 6
  • 42
  • 66
0
votes
0 answers

How to Encrypt String with accented characters in Swift

I have a string which contains some special characters, spaces and, accented characters. Example: j’aime trop ma série I am using Commoncypto to encrypt the strings. It works when the string contains plain text. But, its not working when the…
chandvoid
  • 133
  • 1
  • 12
0
votes
2 answers

NSData Sha512 Hashing with Xamarin

I have an example of SHA512 hash of two NSData objects (Objective-C) Objective C SHA512 hash of two NSData that's in objective C, using the CommonCrypto, however I have tried to do the same thing using the SHA512Managed Class but could not get the…
AISAC
  • 821
  • 1
  • 9
  • 14
0
votes
1 answer

How to add salt in iOS and retrieving it using objective c without memory leakage

I have appended the IV to the AES Encryption/decryption code by using objective c in iOS and able to decrypt and encrypt the same. Right now I am trying to add the salt to the AES Encryption but unfortunately its not working for me.
User1075
  • 819
  • 15
  • 36
0
votes
1 answer

CCCrypt - Type of expression is ambiguous without more context after iOS 14 update

So this morning I updated my OS and XCode to iOS 14, as prompted by the system. However, when I opened XCode after the update, I encountered the error Type of expression is ambiguous without more context. I have not changed the code, and it was…
kyrers
  • 489
  • 1
  • 6
  • 22
0
votes
1 answer

How to use 2TDEA option of 3DES with CommonCrypto

When I am encrypting data with CCCrypt() with 3DES algorithm I have to provide 24bytes long key like for 3TDEA option of 3DES. From a reason I have use 2TDEA with 16bytes long key. But when I use 16byte key, CCCrypt() fails. What to do with…
0
votes
0 answers

AES CommonCrypto: String Decryption is Not in Proper Format for JSON API response

I am using common crypto encryption and decryption. I am using AES for API calling and response. I have done everything right but whenever I am doing decryption of the received response, only the first key in response in not getting decrypted,…
Suhas Arvind Patil
  • 1,732
  • 1
  • 19
  • 31
0
votes
1 answer

What are the ways to implement Diffie Hellman to generate public and private key in iOS swift/Objective C?(Other than Chilkat)

The requirement is, there would be two devices(alice and bob)generates public and private keys using diffie hellman. public keys would get exchanged bewteen both the devices (alice and bob) and generate a secret key with their private keys. This is…
0
votes
2 answers

Is There A Swift preprocessor Way to Detect Bridging Header Includes?

The only answer I found was in this, and I'm not satisfied with it. I am adding a standard MD5 converter as a String extension: /*…
Chris Marshall
  • 4,910
  • 8
  • 47
  • 72
0
votes
1 answer

iOS Common Crypto Decrypt RC4 Encrypted video file Memory crash

I am decrypting a video file which works perfectly for small sizes files but for files above 300mb, there is memory crash. The code is as below : I checked the start byte value it goes uptill 315mb and then crashes, my file is sized at 350mb. It…
Mukul More
  • 554
  • 2
  • 5
  • 18
0
votes
0 answers

App crashed due to error "Invalid pointer dequeued from free list" in Objective-C

I am getting following error, when we generate key for AES Encryption/Decryption. malloc: *** error for object 0x1c421b840: Invalid pointer dequeued from free list *** set a breakpoint in malloc_error_break to debug Below added code for Generate…
vijay
  • 1,235
  • 1
  • 11
  • 32
0
votes
0 answers

CommonCrypto equivalency with Java Cipher

I am trying to decrypt a string encrypted via Apple's CommonCrypto API. It is using AES/CBC/PKCS7Padding. It takes the input string and a user provided password and generates the corresponding encrypted string which is Base64 encoded. However, I…
jash