RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).
Apache License 2.0
131
stars
58
forks
source link
feat: Add gcm algorithm for cross platform encryption/decryption #33
This pull request adds a new algorithm case called gcm.
This will use SHA1 for signing/verifying.
For encryption/decryption it will use:
EVP_aes_128_gcm
16 Byte 0 IV
the RSA key modulus and publicExponent in an ASN1 sequence as AAD
This makes it compatible with the Apple SecKeyCreateEncryptedData/SecKeyCreateDecryptedData.
As a result you will be able to encrypt on an apple device and decrypt on linux using this algorithm.
The travis builds will fail until a new patch of openSSL 1 and 2 with EVP_CIPHER_CTX_init_wrapper are released
Motivation and Context
This is a fix for issue #32 to allow cross platform RSA encryption.
How Has This Been Tested?
The gcm algorithm has been added to the current tests.
Two new tests have also been added using previously encrypted data from linux and mac to test cross platform support.
Description
This pull request adds a new algorithm case called gcm. This will use SHA1 for signing/verifying. For encryption/decryption it will use:
This makes it compatible with the Apple SecKeyCreateEncryptedData/SecKeyCreateDecryptedData. As a result you will be able to encrypt on an apple device and decrypt on linux using this algorithm.
The travis builds will fail until a new patch of openSSL 1 and 2 with
EVP_CIPHER_CTX_init_wrapper
are releasedMotivation and Context
This is a fix for issue #32 to allow cross platform RSA encryption.
How Has This Been Tested?
The gcm algorithm has been added to the current tests. Two new tests have also been added using previously encrypted data from linux and mac to test cross platform support.