Converted RC4, RC4Drop and Derive EVP

This commit is contained in:
Matt C 2018-05-14 18:30:52 +01:00
parent 4008dbf38a
commit 24e4e268dc
5 changed files with 345 additions and 155 deletions

View file

@ -2,11 +2,14 @@
* Cipher functions.
*
* @author Matt C [matt@artemisbot.uk]
* @author n1474335 [n1474335@gmail.com]
*
* @copyright Crown Copyright 2018
* @license Apache-2.0
*
*/
import OperationError from "../errors/OperationError";
import CryptoJS from "crypto-js";
/**
* Affine Cipher Encode operation.
@ -60,3 +63,19 @@ export function genPolybiusSquare (keyword) {
return polybius;
}
/**
* A mapping of string formats to their classes in the CryptoJS library.
*
* @private
* @constant
*/
export const format = {
"Hex": CryptoJS.enc.Hex,
"Base64": CryptoJS.enc.Base64,
"UTF8": CryptoJS.enc.Utf8,
"UTF16": CryptoJS.enc.Utf16,
"UTF16LE": CryptoJS.enc.Utf16LE,
"UTF16BE": CryptoJS.enc.Utf16BE,
"Latin1": CryptoJS.enc.Latin1,
};