# Base64 encoding with a key

**URL:** <https://community.postman.com/t/base64-encoding-with-a-key/9309>\
**Category:** Help Hub\
**Tags:** authentication\
**Created:** [November 28, 2019, 6:29am UTC](https://community.postman.com/t/base64-encoding-with-a-key/9309 "2019-11-28T06:29:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qatest1305](https://avatars.discourse-cdn.com/v4/letter/q/ea5d25/32.png) [@qatest1305](https://community.postman.com/u/qatest1305)\
**Post date:** [November 28, 2019, 6:29am UTC](https://community.postman.com/t/base64-encoding-with-a-key/9309/1 "2019-11-28T06:29:08Z")

</div>

I have a scenario to encode my request body into base64 with a key. And here is the key which works in JS but uses JSEncrypt library. I am unable to use this library and did not find a way to install js libraries in postman. Can someone help me here, this is the step one and post this i would be able to build my API automation suite.

var encrypt = new JSEncrypt();  
encrypt1.setPublicKey(public\_key);  
var encrypted = encrypt.encrypt(“{"customerId": "10000001111111", "password": "abcd123", "timeStamp": "1574839679"}”);  
console.log(encrypted);

---

<div class="post-metadata">

**Author:** ![arlem](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/arlem/32/3078_2.png) [@arlem](https://community.postman.com/u/arlem)\
**Post date:** [December 2, 2019, 2:04pm UTC](https://community.postman.com/t/base64-encoding-with-a-key/9309/2 "2019-12-02T14:04:45Z")

</div>

Hi @qatest1305 and welcome here! 😃

You cannot install new libraries at the moment but Postman come with a few preinstalled one as you can see on [the Postman Sandbox page](https://learning.getpostman.com/docs/postman/scripts/postman-sandbox/#commonly-used-libraries-and-utilities).  
This includes [CryptoJS](https://code.google.com/archive/p/crypto-js/) which should allow you to do what you’re asking for.
