Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Non-functional RSA-OEAP Support #49

Open
cryptoAlgorithm opened this issue Jul 4, 2021 · 0 comments
Open

Non-functional RSA-OEAP Support #49

cryptoAlgorithm opened this issue Jul 4, 2021 · 0 comments

Comments

@cryptoAlgorithm
Copy link

In my React Native project, I decrypt data sent from another React frontend. The 2 most heavily used algorithms are RSA-OEAP and AES-GCM. Unfortunately, I found that the RSA-OEAP support was pretty broken, and using this

crypto.subtle.encrypt(
    {
        name: "RSA-OAEP",
        //label: Uint8Array([...]) //optional
    },
    publicKey, //from generateKey or importKey above
    data //ArrayBuffer of data you want to encrypt
)
.then(function(encrypted){
    //returns an ArrayBuffer containing the encrypted data
    console.log(new Uint8Array(encrypted));
})
.catch(function(err){
    console.error(err);
});

snippet from the WebCrypto examples repo in the readme caused an error:

Possible Unhandled Promise Rejection (id: 0):
TypeError: undefined is not an object (evaluating 'algorithm.hash.name.toUpperCase')

After adding the hash name (SHA-512), it didn't return any error but returned an empty ArrayBuffer []

I hope that this issue can be fixed soon (maybe by merging the latest mscrypto library?) so that i can use this library in my project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant