Enc / Dec JS Implementation