encrypting and decrypting using driver's API