Skip to content

Commit

Permalink
Merge pull request #82 from ArslanKibria98/feature/node-infra
Browse files Browse the repository at this point in the history
privateKet encryption/decryption
  • Loading branch information
zikriya authored Oct 17, 2023
2 parents 1f250a8 + f156eb4 commit 4580fd2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ export const RANDOM_KEY =
export const CUDOS_CHAIN_ID = 'cudos-1';
export const THRESHOLD = 360;
export const NUMBER_OF_VALIDATORS_SHOULD_BE = 1;
let SECURITY_KEY = '';

export const getSecurityKey = function () {
return SECURITY_KEY;
};

export const setSecurityKey = function (securityKey: string) {
SECURITY_KEY = securityKey;
};
export const NETWORKS = [
{
chainId: '56',
Expand Down Expand Up @@ -113,6 +122,11 @@ export const createAuthTokenForMultiswapBackend = function () {
return encryptedSessionToken;
};

export const getPrivateKey = function () {
const privateKey = process.env.PRIVATE_KEY as string;
return decrypt(privateKey, SECURITY_KEY);
};

export const encrypt = function (data: string, key: String) {
try {
var ciphertext = CryptoJS.AES.encrypt(data, key).toString();
Expand Down

0 comments on commit 4580fd2

Please sign in to comment.