Use cryptsetup to setup dm-crypt managed device-mapper mappings. This method will allow you to use an encrypted mapping to transparently read and write encrypted data so that you and your applications don’t even need to worry about handling any encryption at all; it will just work, trust me. If you need to save data that’s already on the device, then copy it somewhere else, encrypt the drive, and copy it all back after encrypting.