Swift CryptoKit and Ruby/Python

1 · Fabien Penso · March 18, 2021, 7:30 p.m.
I spent days figuring out how to decrypt ChaChaPoly encrypted data with Swift CryptoKit using other languages. What should have taken me minutes took me hours. As a time savior, here is how you can decrypt it using Ruby or Python. I ended up reading the source code of swift-crypto to understand what’s the combined sealbox was doing. Use the following in Xcode Playground to encrypt a string: import UIKit import CryptoKit let str = "Hello, playground" let strData = str.data(using: .utf8)! let ke...