Questions tagged [cryptoswift]

CryptoSwift is a collection of standards and algorithms to fulfill most cryptographic needs.

CryptoSwift is a collection of standards and algorithms to fulfill most cryptographic needs.

81 questions
1
vote
0 answers

CRC32 calculation with the lib cryptoswift

I am trying to convert a java code to Swift. I am using a lib CryptoSwift. This the java code if(mcrc==0) { Checksum checksum = new CRC32(); checksum.update(pDataResult, 0, iDest); long checksumValue = checksum.getValue(); mcrc=1; …
Bolo
  • 2,668
  • 4
  • 27
  • 34
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
0 answers

AES ECB mode encryption using CryptoSwift

I want to do ECB mode encryption of AES algorithm. I have used CryptoSwift. I want to do encryption with ECB mode, key size 64 bits (random key) & no padding. I have tried the following code but it is returned at AES instance. Anyone can help me…
Komal Goyani
  • 779
  • 6
  • 25
0
votes
1 answer

Generating an AES key, encrypting and decrypting with CryptoSwift doesn't decrypt back to "Hello World"

I'm building a simple app, where users can add personal diary entries in the form of text only, and it gets saved to my cloud firestore database. Now, I want to build end-to-end encryption so the user's personal content is never readable by anyone…
0
votes
1 answer

AES-CBC: using CryptoJS in React-Native and CryptoSwift in Swift

I'm building a React-Native app that uses NotificationServiceExtension on iOS to intercept encrypted notifications and decrypt them before showing to the user. On the react-native side, I encrypt the message using CryptoJS: const originalText =…
Chris
  • 13
  • 3
0
votes
0 answers

How to create a Secure QRCode in Swift that can be only scan by a single app?

How to create a Secure QRCode in Swift that can be only scan by a single app? Can we encrypt and decrypt the QRCode values using sha56?
0
votes
0 answers

Why is IV="" encryption in CryptoSwift not working on Swift5?

I have an error trying to encrypt my password. I can't find a reason why encryption(iv = "") works well with swift 3 but now is not working with iv = "" in swift 5. How do I fix this? userText = userText.replacingOccurrences(of: "\\s+", with: "",…
0
votes
3 answers

Swift - AES base64 + md5 decryption

I'm trying to decrypt a message sent from our server. Both our server and my Android client side uses the encryption code from here: https://gist.github.com/jafetsanchez/1080133 The server uses the CS code to encrypt the message My android client…
dor506
  • 5,246
  • 9
  • 44
  • 79
0
votes
0 answers

IOS Decrypt string with CryptoSwift

I want to decrypt string in base64 and when i create string from decrypted data i get nil in my string. Here's my code: private func xd(url: String?) -> URL? { guard let enryptedData = Data(base64Encoded: url ?? "") else { return nil } let…
TroYan
  • 1
0
votes
1 answer

How to Decrypt a string using AES-256 CFB with PKCS5PADDING in swift?

I am looking to decrypt a string using AES, I tried multiple solution from SO but none of them helped and I was unable to get the solution. The android developer used Cipher to do it below is the code for that:- private static final byte[]…
Irshad Qureshi
  • 807
  • 18
  • 41
0
votes
1 answer

Decrypt AES in ECB mode

I'm trying to decrypt a simple frame : uint8_t chipertext[] = {0x72, 0x82, 0xC9, 0xAA, 0x1F, 0xE1, 0x84, 0x97, 0x06, 0x65, 0x58, 0x5D, 0x06, 0x7B, 0xD4, 0xB4}; which was encrypted by the following key : uint8_t aes_key[] = {0x0A, 0x1A, 0x2A,…
Silvering
  • 756
  • 1
  • 6
  • 33
0
votes
1 answer

iOS 13 AES decrypt with Crypto Swift not working

I have an app which uses AES256 decryption for authentication. For this I use the Crypto Swift library. Until now it always worked, but with iOS 13 coming out, the decryption does not work. Here's the code I use for decryption: func…
Esera
  • 217
  • 2
  • 10
0
votes
1 answer

Swift equivalent of MessageDigest in Java?

I am trying to do auth encryption in my app, its working for kotlin but not for swift. We are trying to use "AES/ECB/PKCS5Padding". Below kotlin code to get secret key. but my swift code is returning different result then kotlin. private fun…
0
votes
1 answer

How to do AES decryption using iv & key with cryptoswift?

Implemented in javascript using cryptojs but unable to do the same in swift using cryptoswift. I am unable to understand how key, iv & ciphertext are generated in javascript looking at the below code. Out of ideas to do the same in Swift using…
Maulik Bhuptani
  • 597
  • 3
  • 14
0
votes
1 answer

Transform Java AES Decryption Code to CryptoSwift

I have a problem with transforming Java Code to Swift for AES Encryption with CBC. Here is the Java Code: public static String decryptOAuthClientSecret(String cipher) { String result = ""; try { Cipher aes =…
Thomas
  • 1
  • 3