const Helpers = require ( "../Helpers" ) ; const { IGE : aes_ige } = require ( "@cryptography/aes" ) ; class IGENEW { private ige : any ; constructor ( key , iv ) { this . ige = new aes_ige ( key , iv ) ; } param cipherText { Buffer } returns { Buffer } decryptIge ( cipherText ) { return Helpers . convertToLittle ( this . ige . decrypt ( cipherText ) ) ; } param plainText { Buffer } returns { Buffer } encryptIge ( plainText ) { const padding = plainText . length % 16 ; if ( padding ) { plainText = Buffer . concat ( [ plainText , Helpers . generateRandomBytes ( 16 - padding ) , ] ) ; } return Helpers . convertToLittle ( this . ige . encrypt ( plainText ) ) ; } } export { IGENEW as IGE } ;