Skip to content

A RSA Javascript encryption library , which can encryt/decrypt long message

License

Notifications You must be signed in to change notification settings

bartlian/jsencrypt-ext

Repository files navigation

Introduction

jsencrypt is a popular RSA Javascript encryption library, but it does not support to encryt/decrypt long message. Although RSA is not recommended to encrypt long plaintext, there are still many business scenes to achieve it. I have extended the lib, based on jsencrypt.

How to use

import JSEncrypt from "jsencrypt-ext";

const encryptInstance = new JSEncrypt();
encryptInstance.setPublicKey("publicKey");

const ciphertext = encryptInstance.encrypt("long plaintext");

const decryptInstance = new JSEncrypt();
decryptInstance.setPrivateKey("privateKey");

const plaintext = decryptInstance.decrypt("ciphertext");

About

A RSA Javascript encryption library , which can encryt/decrypt long message

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published