All Projects → loveiset → RSAForPostman

loveiset / RSAForPostman

Licence: other
add rsa encryt for postman

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to RSAForPostman

vapi
vAPI is Vulnerable Adversely Programmed Interface which is Self-Hostable API that mimics OWASP API Top 10 scenarios through Exercises.
Stars: ✭ 674 (+3270%)
Mutual labels:  postman
postman-patcher
Allows postman to render javascript in preview
Stars: ✭ 36 (+80%)
Mutual labels:  postman
pern-stack-auth
📋 Repair. PERN stack todo app with jwt user authentication
Stars: ✭ 17 (-15%)
Mutual labels:  postman
NewmanPostman VSTS Task
A task for Azure DevOps Pipelines to run newman tests.
Stars: ✭ 31 (+55%)
Mutual labels:  postman
postman-util-lib
🚀 A crypto utility library to be used from Postman Pre-request and Tests script tabs.
Stars: ✭ 42 (+110%)
Mutual labels:  postman
api-projeto-livre
Projeto de conclusão do Bootcamp Back-End {reprograma}, turma 7, em parceria com o MINAs do Porto Digital de Recife.
Stars: ✭ 12 (-40%)
Mutual labels:  postman
go-echo-boilerplate
The fastest way to build a restful API with golang and echo framework. Includes common required features for modern web applications. A boilerplate project with golang and Echo.
Stars: ✭ 53 (+165%)
Mutual labels:  postman
super-powered-api-testing
Comparisons of powerful API testing tools
Stars: ✭ 25 (+25%)
Mutual labels:  postman
httpbook
Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
Stars: ✭ 18 (-10%)
Mutual labels:  postman
testkube
☸️ Kubernetes-native framework for test definition and execution
Stars: ✭ 172 (+760%)
Mutual labels:  postman
libVES.c
VESvault End-to-End Encryption API: Encrypt Everything Without Fear of Losing the Key
Stars: ✭ 28 (+40%)
Mutual labels:  rsa-encryption
setup-linux-debian
Installs essential JavaScript development programs.
Stars: ✭ 16 (-20%)
Mutual labels:  postman
fluffychat
🐑 Decentralized chat with private messages and rooms. Messages and files are encrypted using RSA
Stars: ✭ 25 (+25%)
Mutual labels:  rsa-encryption
axon
Autogenerate Integration Tests
Stars: ✭ 49 (+145%)
Mutual labels:  postman
Multi-Face-Comparison
This repo is meant for backend API for face comparision and computer vision. It is built on python flask framework
Stars: ✭ 20 (+0%)
Mutual labels:  postman
postman-exporter
Postman exporter for Prometheus
Stars: ✭ 13 (-35%)
Mutual labels:  postman
vsphere-automation-sdk-rest
REST (Postman and JavaScript) samples and API reference documentation for vSphere using the VMware REST API
Stars: ✭ 194 (+870%)
Mutual labels:  postman
btrackers-postman
btrackers-postman - BitTorrent Trackers Postman, fetch BitTorrent Trackers URL list from ngosang/trackerslist and post to your aria2 server via jsonrpc.
Stars: ✭ 13 (-35%)
Mutual labels:  postman
covid
COVID-19 updates webpage
Stars: ✭ 117 (+485%)
Mutual labels:  postman
Platform
The DigitalState Platform
Stars: ✭ 39 (+95%)
Mutual labels:  postman

RSAForPostman

usage

you can skip following setting steps, and using example code(pre-script) directly to test a RSA encrypt (see how to use it)

reference

this project is based on forge Project

how to build

First you need to install node and git on your pc.

clone forge and install

git clone https://github.com/digitalbazaar/forge.git
cd /path/to/your/dir
npm install

modify configure

modifywebpack.config.js, replace umd with var

  const bundle = Object.assign({}, common, {
    output: {
      path: path.join(__dirname, 'dist'),
      filename: info.filenameBase + '.js',
      library: info.library || '[name]',
      libraryTarget: info.libraryTarget || 'var'
    }
  });
  if(info.library === null) {
    delete bundle.output.library;
  }
  if(info.libraryTarget === null) {
    delete bundle.output.libraryTarget;
  }

  // optimized and minified bundle
  const minify = Object.assign({}, common, {
    output: {
      path: path.join(__dirname, 'dist'),
      filename: info.filenameBase + '.min.js',
      library: info.library || '[name]',
      libraryTarget: info.libraryTarget || 'var'
    },
    devtool: 'cheap-module-source-map',
    plugins: [
      new webpack.optimize.UglifyJsPlugin({
        sourceMap: true,
        compress: {
          warnings: true
        },
        output: {
          comments: false
        }
        //beautify: true
      })
    ]
  });

repack

npm run build

then in dist folder, we'll find a file named forge.js, that's what we need.

how to use it

because Postman can not load js file from local disk, so we put forge.js on a web server(url on github seems not work, a local server may works or add a varible forgeJS manully).

EDIT: using github raw format works, so you guys can using this example directly

pre-script

//download forgeJS from web and set varible

if (!pm.globals.has("forgeJS")) {
    pm.sendRequest("http://10.52.16.143/logs/forge.js", function (err, res) {
        if (err) {
            console.log(err);
        } else {
            pm.globals.set("forgeJS", res.text());
        }
    })
} else {

    eval(pm.globals.get("forgeJS"))

    const public_key = '-----BEGIN PUBLIC KEY-----\n' +
        'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDORoOSW2gbHl6s/YmS1jWxb954\n' +
        'X/jflZ2dK65oM/Bxii2Iba80IiC9+Sa1phmOVDAk+IVDsPNZ+YJ2Qg0hPmoLSLxe\n' +
        'f2A6ySJPl5su8TaGOuVZg1SRyk55bjHymQUnxryD/ml1EmBUaGcrs9FCiVBy38kg\n' +
        'eZNbCexucVQxn6OYlwIDAQAB\n' +
        '-----END PUBLIC KEY-----'

    const private_key = '-----BEGIN PRIVATE KEY-----\n' +
        'MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAM5Gg5JbaBseXqz9\n' +
        'iZLWNbFv3nhf+N+VnZ0rrmgz8HGKLYhtrzQiIL35JrWmGY5UMCT4hUOw81n5gnZC\n' +
        'DSE+agtIvF5/YDrJIk+Xmy7xNoY65VmDVJHKTnluMfKZBSfGvIP+aXUSYFRoZyuz\n' +
        '0UKJUHLfySB5k1sJ7G5xVDGfo5iXAgMBAAECgYEAk6KQZN4bQt2XsYS9RGUghOCm\n' +
        'f81g2NXCu00aROZ3vyvArxaiAVQzzwRWGkjJnb7PvoZJC0vIwKr+HxnjP9nmFufd\n' +
        '+0EnBT+imYSzrfZhfGGwyI6EIyy/XcoW5lf0xltx3w9mJicnR9kMzNtZ5mNGPMNn\n' +
        'CgAgjvZqnWYb+f6tb/ECQQD0tdpg8ts3puXclPe51my+LbKhEbyFSMzvtMTDCRmO\n' +
        'd0jrmZhQomsZacC8+l+2l6WTj5vrhVQlAVUeUJ7kldQNAkEA18q53wor6a4Cv0OL\n' +
        'xFzBWXRCMVFfyCWAFQUpTSGrIM/X4Lx30IZCShtvkdh1ky39b9T6lpOjES7MK4Dh\n' +
        'xttCMwJAUGBi6DEcm/zvxzIO5DVv5k9wOsNunoC4/4rqjf0xLcA0bV43z1RpxSEd\n' +
        'M3UxdvH8aqli10slxjnX0Ws9pWspCQJBALqSncgYzETbXaauqO5a4BUOrphjafPr\n' +
        'cGU8NCxrGsFg0p6NdO5G1pOqSvmHdIiPL9t8AjkkZs3Zb0+BvDOpqP8CQQDZhfh4\n' +
        '/c/Qzp4szj7+GXTZ1cmGwAuFo2/9uiumUAS3f19EpgoV9u9eyJ4gZPEBDvAjO961\n' +
        'kAjdja4DAy4SbCXy\n' +
        '-----END PRIVATE KEY-----'


    //encrypt text "plaintext"
    var publicKey = forge.pki.publicKeyFromPem(public_key);
    var encryptedText = forge.util.encode64(publicKey.encrypt("plaintext", 'RSA-OAEP', {
        md: forge.md.sha1.create(),
        mgf1: {
            md: forge.md.sha1.create()
        }
    }));
    console.log("encrypted text:" + encryptedText);

    // decrypt text
    var privateKey = forge.pki.privateKeyFromPem(private_key);
    var decryptedText = privateKey.decrypt(forge.util.decode64(encryptedText), 'RSA-OAEP', {
        md: forge.md.sha1.create(),
        mgf1: {
            md: forge.md.sha1.create()
        }
    });

    console.log("dectypted text:" + decryptedText);


}

you can use rsa encrypt in postman now! example

something else

about web server

if you don't want to use a web server, you an simply create a globle varible named forgeJS and copy content in forge.js to the value(postman may be very slow because the file is big)

how to delete the varible

because of forgeJS varible, it may be very diffcuilt to edit other varible in postman, to solve this, you can delete the forgeJS varible

pm.globals.unset("forgeJS");

document about RSA encrypt

https://github.com/digitalbazaar/forge

ps

this thing is a temporary solution, we all hope postman can support RSA encrypt oneday officially.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].