Nip44Padding

NIP-44 padding scheme for encrypted messages.

Implements the padding algorithm specified in NIP-44 to prevent plaintext length leakage. Pads messages to specific boundaries that obscure the original message length.

See also

Functions

Link copied to clipboard
fun calcPaddedLen(unpadded: Int): Int

Calculates the padded length for a given plaintext length.

Link copied to clipboard
fun pad(plaintext: String): ByteArray

Pads plaintext according to NIP-44 padding scheme.

Link copied to clipboard
fun unpad(padded: ByteArray): String

Removes padding from NIP-44 padded data.