UNPKG

@meeco/cryppo

Version:

In-browser encryption and decryption. Clone of Ruby Cryppo

28 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.strategyToAlgorithm = exports.CipherStrategy = void 0; var CipherStrategy; (function (CipherStrategy) { CipherStrategy["AES_GCM"] = "AES-GCM"; // AES_ECB = 'AES-ECB', // Require 16 bytes IV And not tested crosscompatiblity with other cryppo // AES_CBC = 'AES-CBC', // AES_CFB = 'AES-CFB', // AES_OFB = 'AES-OFB', // AES_CTR = 'AES-CTR', // DES_ECB = 'DES-ECB', // DES_CBC = 'DES-CBC', // Not currently suppoted as they have different key size (256 not supported) // THREE_DES_ECB = '3DES-ECB', // THREE_DES_CBC = '3DES-CBC', })(CipherStrategy || (exports.CipherStrategy = CipherStrategy = {})); /* * Convert an algorithm from a serialized payload (e.g Aes256Gcm.data.artifacts) in the ruby lib's naming * scheme to one that can be used by forge */ const strategyToAlgorithm = (algorithm) => algorithm .split(/[0-9]+/) .map((v) => v.toUpperCase()) .join('-'); exports.strategyToAlgorithm = strategyToAlgorithm; //# sourceMappingURL=strategies.js.map