Crypto library used in Vivy iOS app
Add to Podfile
:
pod 'Krypt'
run pod install
// Encrypt
let dataToEncrypt: Data = ...
let publicKey: Key = ...
let encrypted = try EHREncryption.encrypt(data: dataToEncrypt, with: publicKey)
encrypted.data // Data
encrypted.cipherKey // base64 String with AES key and IV
encrypted.version // Version
// Decrypt
let privateKey: Key = ...
let decrypted = try EHREncryption.decrypt(encryptedData: encrypted, with: privateKey) // Data
- clone the repo
- run
./bootstrap.sh
from root of cloned repo to setup SwiftFormat
Krypt is available under the MIT license. See the LICENSE file for more info.
This product includes software developed by the "Marcin Krzyzanowski" (http://krzyzanowskim.com/).