Security implementation using BouncyCastle