added rsa encoded func