Encryption

interface Encryption(source)

Platform-independent encryption abstraction for secure data storage. This interface provides a standardized way to protect sensitive data while allowing different encryption implementations based on security requirements.

Key features:

  • Transparent encryption/decryption of text data

  • Platform-independent API

  • Support for different encryption algorithms

  • String-based input/output for easy integration

Example implementation might use AES-256-GCM:

class Aes256GCMEncryption : Encryption {
override fun encrypt(text: String): String {
// Implement AES-256-GCM encryption
}
override fun decrypt(text: String): String {
// Implement AES-256-GCM decryption
}
}

Inheritors

Functions

Link copied to clipboard
abstract fun decrypt(text: String): String

Decrypts previously encrypted text back to its original form. Implementations should ensure:

Link copied to clipboard
abstract fun encrypt(text: String): String

Encrypts the given text using the implementation-specific algorithm. Implementations should ensure: