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
1 answer

iOS AES 256 Decryption not working in swift

I have scenario in which some the data will come encrypted in JSON Response. So I tried some libraries to decryption in swift. But eventually I failed to do that. So I tried this library WebCrypto:…
Abhishek Thapliyal
  • 3,497
  • 6
  • 30
  • 69
1
vote
1 answer

How to solve "dataPaddingRequired" error CryptoSwift

I have key = "somesomesomesome".md5(), length is 32 bytes, iv is empty, trying to decrypt encrypted string using CryptoSwift: let aes = try AES(key: key.bytes, blockMode: CBC(iv: []), padding: .noPadding) let result = try aes.decrypt(encrypted) let…
zzheads
  • 1,368
  • 5
  • 28
  • 57
1
vote
1 answer

CCCrypt maximum time it returns nil. What is the problem in Encryption

I trying to write an encryption (AESCBC128) function based on CCCrypt and the CCCrypt is generating a random value. for example, when I pass 016768821221 to function it'll return "0oTPFcKNWABTpBGgLlzsjw==" for the same iv and Key. here's the iv:…
Khabbab_h
  • 19
  • 6
1
vote
1 answer

CryptoSwift: unresolved identifier 'GCM'

xcode version: 9.3.1 (9E145) Swift version: 4.1 I have just downloaded the latest master copy and installed CryptoSwift using CocoaPods. Using the example given on the README: do { // In combined mode, the authentication tag is directly appended…
1
vote
1 answer

Install manually Crypto swift library. Unexpected platform condition

I am trying to install Crypto swift library for AES encryption manually based on their instructions. but I get two compile error. First one is : Unexpected platform condition (expected 'os', 'arch', or 'swift') and the second one is: No such module…
1
vote
1 answer

how can encrypt AES 256 with cryptojs and decrypt in swift

I am trying to decrypt a string which is decrypted by cryptojs but not luck...I try to cryptoswift but still faileu var encrypted = CryptoJS.AES.encrypt("mystringforencryption", "secret"); …
1
vote
2 answers

Get hash from file using CryptoSwift

So I try to get the hash from a file. Using the CryptoSwift library. The truth is the variable with the hash that I got from the VLC website, so that should be true. However, the hash I generate is different from the hash I know to be the…
user5087998
1
vote
2 answers

Type of expression is ambiguous without more context CryptoSwift Swift 4

When I am using Crypto Swift in Swift 4 , it is giving below error Type of expression is ambiguous without more context Below is the code which I have posted for encryption func aesEncrypt(_ key: String, iv: String) throws -> String { let data…
Hitesh Mor
  • 72
  • 1
  • 11
1
vote
2 answers

How to transform JavaScript HMAC code to CryptoSwift implementation?

I want to transform this JavaScript HMAC code to Swift using CryptoSwift library. var crypto = require("crypto"); var currentDate = Moment.utc().format("YYYYMMDDHH"); var hmac = crypto.createHmac("sha256",…
funkenstrahlen
  • 3,032
  • 2
  • 28
  • 40
1
vote
1 answer

Equivalent encryption in java and ios using CryptoSwift

public static String encryptStringToBase64(String messageString) { byte[] messageBytes = messageString.getBytes("UTF-8"); byte[] encrypted = convert(1, messageBytes); return Base64.encodeBytes(encrypted); } private…
rams
  • 652
  • 1
  • 9
  • 24
1
vote
1 answer

Getting error in cocapod installation CryptoSwift

i installed a pod successfully "cryptoSwift' to get sha-2 in my xcode project using swift2. but after pod installation when i build project it shows me a lot of error in pod files. why i am getting this error. what's i am doing wrong? Thanks in…
Mubashar
  • 333
  • 6
  • 15
1
vote
0 answers

How do I embed CryptoSwift into WatchKit Extension target without build error?

I am trying to embed CryptoSwift as an embedded framework into a Watch app (watchOS3) - I would like to be able to use AES encryption and decryption from within the Watch app. I start by creating a new clean Xcode project: watchOS application using…
1
vote
1 answer

AES extra argument 'padding' in call? swift2

I make extension to generate function to encrypt and decrypt with AES like this : import cryptoswift extension String { func aesEncrypt(key: String, iv: String) throws -> String{ let data = self.dataUsingEncoding(NSUTF8StringEncoding) let…
Sarimin
  • 707
  • 1
  • 7
  • 18
1
vote
1 answer

CryptoSwift AES128-CBC with Swift

I'm getting this error while decrypting an AES128CBC encrypted JSON: assertion failed: Block size and Initialization Vector must be the same length!: file ##### for iOS/CryptoSwift/Sources/CryptoSwift/AES.swift, line 97 I'm using the…
Daniel R.
  • 31
  • 2
  • 5
1
vote
2 answers

CryptoSwift cannot use swift 2

I would like to use https://github.com/krzyzanowskim/CryptoSwift on my swift project (my swift is 2.1 and Xcode 7.1.1). After I had completed the installation instruction (run build.sh then add the framework file to my project), I still cannot…
Tommy Liu
  • 239
  • 4
  • 13