• Encrypts data using the given parameters.

    Parameters

    • data: string

      The data to be encrypted.

    • iv: string

      The initialization vector.

    • password: string

      The password for encryption.

    • salt: string

      The salt for key derivation.

    Returns string

    The encrypted data.

    Example

    const data = 'Sensitive information';
    const iv = '1234567890123456'; // 16 characters
    const password = 'MySecretPassword';
    const salt = 'MySalt';
    const encrypted = encrypt(data, iv, password, salt);
    console.log(encrypted);

Generated using TypeDoc