encryptPrivateKey

fun encryptPrivateKey(plaintext: ByteArray, keyIndex: Int): ByteArray

Encrypt an address's private key. This function optimizes the size of the ciphertext but makes an assumption on the size of the plaintext and the uniqueness of keyIndex. If you cannot provide a unique keyIndex or do not have a 32 or 64 byte message, instead use encrypt and decrypt. These functions include a pseudorandom IV in the returned ciphertext so do not require keyIndex.

Parameters

plaintext

The key to encrypt

keyIndex

A unique number associated with each key. If you use keys from multiple derivation paths, you must uniquely enumerate them