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

Non-functional RSA-OEAP Support #49

Description

@cryptoAlgorithm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions