Encrypt data with crypto-js and decrypt it with the built-in Node.js crypto module.

_Prerequisite: __Knowledge of JavaScript, Node.js, and basic knowledge of _Postman

Recently, I started interacting with a project’s backend that accepts only encrypted dat — that is, plaintext is converted to  ciphertext before it is sent to the backend. On the backend, the ciphertext is then decrypted back to plaintext. The backend was written with Java, so I thought about how to accomplish this with Node.js.

Since I hadn’t done such a thing before, I had to do some research to see how this was done. Once I discovered what I was looking for, I had to test my findings. And the fastest way to test an API without creating a frontend is with  Postman.

According to _BlazeMeter**, Postman_**_ is a popular API client that makes it easy for developers to create, share, test and document APIs. This is done by allowing users to create and save simple and complex HTTP/s requests, as well as read their responses. The result — more efficient and less tedious work._

Even though I had experience with Postman, I didn’t know how to encrypt data before making a request yet. So, I began another round of research and stumbled upon a tab on Postman called Pre-request Script. As the name implies, it’s a script that runs just before a request is sent.

Orange underlined tab

#javascript #encryption #programming #nodejs

How to Send Encrypted Data with Postman
7.75 GEEK