a-sit-plus / signum

Kotlin Multiplatform Crypto/PKI Library and ASN1 Parser + Encoder
https://a-sit-plus.github.io/signum/
Apache License 2.0
39 stars 2 forks source link

Encryption functionality #103

Open VictorKabata opened 1 month ago

VictorKabata commented 1 month ago

First of all, awesome lib you have here.

Does the library provide encryption functionality after getting the Rsa public key from a X509 certificate?

Something like:

val cipher: Cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding")
cipher.init(Cipher.ENCRYPT_MODE, rsaPublicKey)
val encryptedPayload: ByteArray = cipher.doFinal(initiatorPasswordByteArray)
JesusMcCloud commented 1 month ago

We're working on it (see draft pull request). but it is going to take a little, since we want to support attestation / deviceCheck and the possibility for remote crypto providers out of the box. You can still use the platform functionality in the meantime

JesusMcCloud commented 1 month ago

To be more precise: Once signing is there, asymmetric encryption comes easy-peasy. Symmetric encryption is planned for later. Since you are asking about asymmetric encryption, some time in September might work out for a release with that feature set. That depends on how fast we get signing going, though

JesusMcCloud commented 2 weeks ago

Signing is progressing nicely. ECDH key agreement and symmetric encryption is planned next. Asymmetric encryption might be possible in parallel. Out of curiosity: why do you want to RSA encrypt?