see https export const decrypt = ( input , k = 32 ) : Buffer => { const padding = input [ input . length - 1 ] ; if ( padding < 1 || padding > k ) { return input ; } return input . slice ( 0 , input . length - padding ) ; } ; see https export const encrypt = ( input , k = 32 ) : Buffer => { const padding = k - ( input . length % k ) ; return Buffer . concat ( [ input , Buffer . alloc ( padding , padding ) ] ) ; } ;