MARKETPLACE
PLUGINS
RSA SUITE USING NODE-RSA
RSA Suite using node-rsa logo

RSA Suite using node-rsa

Published May 2025
   •    Updated this month

Plugin details

Whole suite of RSA Cryptographic functions provided by the node-rsa npm package: encryption,decryption,signing, verifying, key information/generation/validation/formatting. Advanced operations options supported, including mask generation function and signing salt length.
Cryptographic operations are run on the context of the provided key on the plugin configuration by default, unless you provide action-specific parameters.

All operations are run on server side actions.

Supported hash algorithms: 'md5', 'ripemd160', 'sha1', 'sha256', 'sha512',  'md4', 'sha', 'sha224', 'sha384'.

Supported encryption/decryption schemes: pkcs1_oaep, pkcs1

Supported signing/verifying schemes: pkcs1, pss.

-------------------------------------------------------------

IMPORTANT NOTICE WHEN USING PSS SCHEME

-------------------------------------------------------------

Please observe the default salt length in node-rsa for PSS scheme is ALWAYS 20.

The salt length must match between sender and receiver in signatures and verifications, and most implementations use either maximum salt length or digest. Therefore, when sending a signature to some other party, the signature should be generated with the salt length expected by the receiving party. Use the advanced options in the key options (see action documentation) to set the saltLength.

This is the table for maximum salt length for common key sizes and hashes:


Key Size (bits) Key Size (bytes) SHA-1 SHA-224 SHA-256 SHA-384 SHA-512
1024 128 106 98 94 78 62
2048 256 234 226 222 206 190
3072 384 362 354 350 334 318
4096 512 490 482 478 462 446

This is the table for salt length when using hash digest length:


Hash Algorithm Digest Length (bytes)
SHA-1 20
SHA-224 28
SHA-256 32
SHA-384 48
SHA-512 64


The formula to calculate salt length is

saltLength = (keySize / 8) - hashLength - 2




https://github.com/rzcoder/node-rsa
https://www.npmjs.com/package/node-rsa



License
Copyright (c) 2014 rzcoder

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Licensing for code used in rsa.js and jsbn.js
Copyright (c) 2003-2005 Tom Wu
All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

In addition, the following condition applies:

All redistributions must retain an intact copy of this copyright notice and disclaimer.

$6

One time  •  Or  $2/mo

stars   •   0 ratings
1 installs  
This plugin does not collect or track your personal data.

Platform

Web & Native mobile

Contributor details

Diego Saavedra San Juan logo
Diego Saavedra San Juan
Joined 2023   •   4 Plugins
View contributor profile

Instructions

You can either use keydata/format/options from the plugin configuration or on each action. Configuration on action supercedes plugin configuration.

Set the operation value on the operation field, as text (can be dynamic). Available operations: 'encrypt', 'encrypt private', 'decrypt, 'decrypt public', 'sign', 'verify'.




Plugin parameters info:


𝐊𝐄𝐘𝐃𝐀𝐓𝐀                                                                    --------------------------------------------------------------------------------- 

{string|object} — parameters for generating key or the key in one of supported formats.

- key in PEM string
- Object contains key components

You can leave this empty at the global and function level and generate an empty key.

You can also autogenerate a key, using an object with format: {b: <keyLength>} ie {b: 512}. See advanced options for more parameters used in key generation.

You can input the key as a string in PEM format:

'-----BEGIN RSA PRIVATE KEY-----MIIBOQIBAAJAV.......'




𝐎𝐏𝐓𝐈𝐎𝐍𝐒                                                                      --------------------------------------------------------------------------------- 


Json object with following fields:


• environment (please observe: use lowercase values) — working environment    (default
  autodetect):                                                        

      ○ 'browser' — will run pure js      implementation of
                                  RSA algorithms.                            

      ○ 'node' for nodejs >= 0.10.x or      io.js >= 1.x —
                                provide some native      methods like
                                sign/verify and      encrypt/decrypt.                                                                                                       
• encryptionScheme — padding scheme for    
 encrypt/decrypt. Can be 'pkcs1_oaep'    or 'pkcs1'. Default
 'pkcs1_oaep'.                                                       


                                                                        • signingScheme — Object containing two parts, scheme used for    signing and
  verifying. Can be 'pkcs1'    or 'pss'. And hash (see supported hash algos below). IE:   {"signingScheme":{"scheme":"pss","hash":"sha256"}}                                                                                                         
Notice: This lib supports hash  algorithms: 'md5', 'ripemd160', 'sha1', 'sha256', 'sha512' in browser and node  environment and additional 'md4', 'sha', 'sha224', 'sha384' in node only.



𝗙𝗢𝗥𝗠𝗔𝗧 𝗦𝗧𝗥𝗜𝗡𝗚 𝗦𝗬𝗡𝗧𝗔𝗫                                          --------------------------------------------------------------------------------- 

Format string composed of several parts:
scheme-[key_type]-[output_type]                                                                                                       

• Scheme — NodeRSA supports multiple format schemes for import/export keys:                                                                                                                     
          ○ 'pkcs1' — public key starts from '-----BEGIN RSA
              PUBLIC KEY-----' header and private key starts from
              '-----BEGIN RSA PRIVATE KEY-----' header                                                                                                    
         ○ 'pkcs8' — public key starts from '-----BEGIN PUBLIC
             KEY-----' header and private key starts from '-----
             BEGIN PRIVATE KEY-----' header                                                                                                                  
         ○ 'openssh' — public key starts from 'ssh-rsa' header
             and private key starts from '-----BEGIN OPENSSH
             PRIVATE KEY-----' header                                                                                                        

• Key type — can be 'private' or 'public'. Default 'private'                                                                            

• Output type — can be:                                                ○  'pem' — Base64 encoded string with header and
                            footer. Used by default.                              ○ 'der' — Binary encoded key data.                                                                                          

Notice: For import, if keyData is PEM string, you cannot specify format, but if you provide keyData as DER you must specify it in format string.                                                                                                   

𝗦𝗛𝗢𝗥𝗧𝗖𝗨𝗧𝗦 𝗔𝗡𝗗 𝗘𝗫𝗔𝗠𝗣𝗟𝗘𝗦                                                                                                        'private' or 'pkcs1' or 'pkcs1-private' == 'pkcs1-private-pem' — private key encoded in pcks1 scheme as pem string.                                                                            

'public' or 'pkcs8-public' == 'pkcs8-public-pem' — public key encoded in pcks8 scheme as pem string.                                                                                        

'pkcs8' or 'pkcs8-private' == 'pkcs8-private-pem' — private key encoded in pcks8 scheme as pem string.                  


'pkcs1-der' == 'pkcs1-private-der' — private key encoded in pcks1 scheme as binary buffer.                                                                                                    

'pkcs8-public-der' — public key encoded in pcks8 scheme as binary buffer.

Types

This plugin can be found under the following types:

Categories

This plugin can be found under the following categories:

Resources

Support contact
Documentation
Tutorial

Rating and reviews

No reviews yet

This plugin has not received any reviews.
Bubble