Skip to content

Commit

Permalink
cryptoservice cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
coilysiren committed Mar 8, 2018
1 parent 7bfc129 commit 3532e23
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions client/app/services/crypto.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,6 @@ export class CryptoService {
};
}

/**
* Randomizing perp Id
*
* @param {string} perpId - inputted perpetrator name
* @returns {string} randomized perp id
*/
private randomizePerpId(perpId) {

const sK = "Project Callisto Super Secret Key";
return sodium.to_base64(sodium.crypto_hash(perpId + sK));

}

/**
* Function for taking user inputs and returning values to be encrypted
* @param {string} perpId - inputted perpetrator name
Expand All @@ -135,7 +122,7 @@ export class CryptoService {
userName,
};

const rid = this.randomizePerpId(perpId);
const rid: string = this.randomizePerpId(perpId);
return this.generateDataValues(rid, userName, record);
}

Expand Down Expand Up @@ -180,6 +167,17 @@ export class CryptoService {
};
}

/**
* Randomizing perp Id
*
* @param {string} perpId - inputted perpetrator name
* @returns {string} randomized perp id
*/
private randomizePerpId(perpId: string): string {
const sK: string = "Project Callisto Super Secret Key";
return sodium.to_base64(sodium.crypto_hash(perpId + sK));
}

/**
* Searches for and returns entries with the same RID
* @returns {Array<IEncryptedData} matched entries
Expand Down

0 comments on commit 3532e23

Please sign in to comment.