@meeco/cryppo
Version:
In-browser encryption and decryption. Clone of Ruby Cryppo
24 lines • 894 B
JavaScript
export 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 || (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
*/
export const strategyToAlgorithm = (algorithm) => algorithm
.split(/[0-9]+/)
.map((v) => v.toUpperCase())
.join('-');
//# sourceMappingURL=strategies.js.map