<PackageReference Include="BouncyCastle.Cryptography" Version="2.5.0" />

FpeEngine

public abstract class FpeEngine
Base class for format-preserving encryption.
protected readonly IBlockCipher baseCipher

protected bool forEncryption

protected FpeEngine(IBlockCipher baseCipher)

protected static bool IsOverrideSet(string propName)

protected abstract int DecryptBlock(byte[] inBuf, int inOff, int length, byte[] outBuf, int outOff)

protected abstract int EncryptBlock(byte[] inBuf, int inOff, int length, byte[] outBuf, int outOff)

public abstract void Init(bool forEncryption, ICipherParameters parameters)

Initialize the FPE engine for encryption/decryption.

public virtual int ProcessBlock(byte[] inBuf, int inOff, int length, byte[] outBuf, int outOff)

Process length bytes from inBuf, writing the output to outBuf.