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
38
votes
12 answers

AES Encrypt and Decrypt

I write an application by swift, i need AES Encrypt and Decrypt functionality, i received encrypted data from another .Net solution, but i can't find something to do it. This is my .net Encryption: public static byte[] AES_Encrypt(byte[]…
mehr
  • 845
  • 1
  • 9
  • 18
16
votes
4 answers

HMAC SHA256 in Swift 4

I have a string and a key, which i want to generate an HMAC SHA256 from it. Although i'm using 2 libs IDZSwiftCommonCrypto and CryptoSwift and this answer Nothing really worked for me. My source of truth are those 2…
Konstantinos Natsios
  • 2,874
  • 9
  • 39
  • 74
7
votes
5 answers

How to hash a string to SHA512 in Swift?

I am building a social media application and I would like some help encoding a password string to SHA512 in Swift. I found the CryptoSwift library on GitHub but I am having a hard time loading it into my Swift project and linking it to my project…
TechnologyGuy
  • 141
  • 3
  • 6
6
votes
1 answer

CryptoSwift - Converting UInt8 array to String resolves as nil

(Xcode 8, Swift 3) Using the CryptoSwift library, I am wanting to encrypt a string and store it in coredata, for some reason, cipherstring results as nil, despite ciphertext having 128 values: let aes = try AES(key: pw, iv: nil, blockMode: .CBC,…
Jimmy3Sticks
  • 172
  • 1
  • 9
5
votes
0 answers

How to fix Pods.sh: line 43 source: unbound variable Command PhaseScriptExecution failed with a nonzero exit code on Xcode 10.2.1?

I'm trying to build and compile my project. It is a heritage from an old coworker which is not longer at the company and I am not that handful on Xcode. Problem is now that I clean and build the project in Xcode, I'm getting a "Command…
Antonio
  • 87
  • 8
3
votes
1 answer

Swift CryptoKit AES Encryption and Javascript AES Decryption

I need to encrypt a value in an iOS app using CryptoKit and send it to a server, which will attempt to decrypt that value using a JavaScript Crypto Library (Right now, we're thinking CryptoJS, but open to other examples). There are a lot of…
Michael Jajou
  • 312
  • 2
  • 13
3
votes
2 answers

flutter problem when update Xcode 12.5 and ios 14.5

when Xcode updated the last version 12.5 when I build IOS app it failed because of flutter and pods Cryptoswift I tried to pod update but it downloads 0.15.0 not the last version of Cryptoswift
Adham Elnagar
  • 143
  • 1
  • 10
3
votes
2 answers

CryptoSwift with AES128 CTR Mode - Buggy counter increment?

i've encountered a problem on the CryptoSwift-API (krzyzanowskim) while using AES128 with the CTR-Mode and my test function (nullArrayBugTest()) that produces on specific counter values (between 0 and 25 = on 13 and 24) a wrong array count that…
Michael S
  • 31
  • 3
3
votes
3 answers

Member 'CBC' takes no arguments

I am integrating the CryptoSwift and found this error "Member 'CBC' takes no arguments". I am calling the function like this let enc = try! AES(key: key, blockMode: .CBC(iv: iv)).encrypt(self.arrayOfBytes())
RussVirtuoso
  • 900
  • 1
  • 9
  • 20
3
votes
1 answer

No such module 'CryptoSwift' in Xcode 8

When I'm converting swift 2.3 to swift 3 happen this error. I did Product->Clean-> Build, but it didn't work in my project. How to solve this error. Please help me.
San San
  • 654
  • 1
  • 7
  • 16
3
votes
1 answer

How to convert bytes to NSString after AES CryptoSwift cipher

I am using CryptoSwift to encrypt data I will be passing in a URL. To do this, I need the datatype of the piece of data to be a String to concatenate into the NSURL request. After encrypting the data it is output in bytes. How can I cast the bytes…
iamnickpitoniak
  • 227
  • 1
  • 4
  • 11
2
votes
0 answers

Converting hmac sha256 to String Swift5

I am trying to obtain the results of a hmac sha256 as a String ,something similar to this "asdafsdfafs13rfafAafaasdfadfasdfa", but the code snippet below generates this byteArray. var combinedString = "key1=val1&key2=val2" //Using…
Ron Brian
  • 41
  • 4
2
votes
2 answers

CryptoSwift - Getting nil when using makeEncryptor() for string of less than 16 bytes in iOS

I am using cryptoSwift library for encryption and decryption. But it's working with only string 16 bytes. If i am passing small string or less than 16 bytes then getting nil result. I am using Incremental operations use instance of Cryptor and…
2
votes
1 answer

CryptoSwift throws invalidKeySize because of base64 encoded aesKey and aesIV

I have a project that retrieve data from API and shows in the app. But API uses AES encryption, I have aesKey and aesIV key and these keys are base64 encoded. I need to encode another string with these keys. To do that I use CryptoSwift library but…
Suat Alkan
  • 39
  • 6
2
votes
0 answers

Converting AES-256-CBC PHP code to Swift doesn't match PHP's result

I am having trouble translating code from my PHP backend to Swift using CryptoSwift. It's AES-256-CBC but either I get an invalidKeySize error or the output produced does not match with the expected output. My PHP code would be, $string =…
javierdemartin
  • 595
  • 6
  • 24
1
2 3 4 5 6