feature: add setEncryptAlg and encode()/decode() function