refactored cryptographic operations to separate utility class