Code-Institute-Org / key-helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyHelper

This is a helper function, which will mask API keys so that they don't have to be stored as is.

It is purely intended for front-end projects, and should not be used for trying to encrypt sensitive information. It is not a replacement for good backend security, but will - at least - modify the API key for Interactive Front End applications.

To use it:

In the <head> of your web page, place the following line:
<script src="https://code-institute-org.github.io/key-helper/helper.js"></script>
To create an obfuscated version of your key, put the following code in your main JavaScript file:

let API_KEY = "yourAPIkey";
console.log(API_KEY.keyHelper());
// Outputs "NehbllrxVC"

Then check the developer tools console for the obfuscated key. Copy this and paste it into your API key field. To get the original key back, simply call the keyHelper() method again like so:

let API_KEY = "NehbllrxVC".keyHelper();
console.log(API_KEY);
// Outputs "yourAPIkey"

About


Languages

Language:JavaScript 100.0%