SecureCompatibleEncryptionExamples
SecureCompatibleEncryptionExamples copied to clipboard
authTagValidation error Swift
I've imported the Swift example and run it on one of the ciphertexts from the README file. The decrypt function always returns authTagValidation error.
I'm using Swift 5, imported SwiftGCM and CommonCrypto.
Example test code:
func testSjclEncrypt() {
let test = "5EmCwwSWj6YYgxBlld6DFW8I+QXCWxz5g/laEwUYV/DuoCGvxbW4ZlMd1Tsj4N07WbBOhIJU"
do {
let decrypted = try AES256.decryptString(ciphertext: test, password: "OziaxPFGYh")
print("decrypted: \(decrypted)")
} catch (let error) {
print("this is error: \(error)")
}
}
Further investigation leads me to discover that Swift is not compatible with Javascript - SJCL. I'm not really an encryption expert, I'd just like to use compatible libraries. Is there a way I can provide more information on this to figure out where the problem may be?
Shortly. Using encryption/decryption witing Javascript works, using encryption with Javascript SJCL and Swift to decrypt, doesn't work.
Hi @igorrendulic my SwiftGCM library is in need of a bit of maintenance which I intend to do this week. They are definitely compatible - an encryption algorithm can be implemented in any language.
Awesome! Let me know if I can help to test.
Hello
I have the same issue, any news or an update? @luke-park
Thank you