Skip to main content

decrypt_account_label

Function decrypt_account_label 

Source
pub fn decrypt_account_label(
    shared_key: &[u8; 32],
    encrypted_data: &[u8],
) -> Result<String, CryptoError>
Expand description

Decrypt an account label from DashPay (DIP-15)

Trailing spaces — the padding encrypt_account_label adds to clear the 48-byte floor — are stripped, recovering the original label. (A label that intentionally ended in spaces cannot round-trip those spaces; this is inherent to the DIP-15 space-padding convention and matches kotlin/dashj.)

§Arguments

  • shared_key - 32-byte shared secret from ECDH
  • encrypted_data - Encrypted label with IV prepended (48-80 bytes total)

§Returns

Decrypted label string