Change encrypt and decrypt arithmetic for iOS and Android