Libraries and test code for encryption