Class EncryptionServiceAES128
- Namespace
- GastroSky.Services.Crypto
- Assembly
- GastroSky.dll
public class EncryptionServiceAES128 : IEncryptionService
- Inheritance
-
EncryptionServiceAES128
- Implements
-
- Inherited Members
-
Constructors
EncryptionServiceAES128(ILogger<EncryptionServiceAES128>?)
public EncryptionServiceAES128(ILogger<EncryptionServiceAES128>? logger)
Parameters
logger ILogger<EncryptionServiceAES128>
Fields
CHUNK_SIZE
public const int CHUNK_SIZE = 8388608
Field Value
- int
NONCE_LENGTH
public const int NONCE_LENGTH = 12
Field Value
- int
TAG_LENGTH
public const int TAG_LENGTH = 16
Field Value
- int
Methods
CalculateCiphertextOutputSize(long)
public long CalculateCiphertextOutputSize(long plaintextSize)
Parameters
plaintextSize long
Returns
- long
CalculatePlaintextOutputSize(long)
public long CalculatePlaintextOutputSize(long ciphertextSize)
Parameters
ciphertextSize long
Returns
- long
Decrypt(Stream, Stream, Memory<byte>, Memory<byte>, ReadOnlyMemory<byte>)
public Task<bool> Decrypt(Stream ciphertext, Stream output, Memory<byte> outPlaintextSHA256, Memory<byte> outCiphertextSHA256, ReadOnlyMemory<byte> encryptionKey)
Parameters
ciphertext Stream
output Stream
outPlaintextSHA256 Memory<byte>
outCiphertextSHA256 Memory<byte>
encryptionKey ReadOnlyMemory<byte>
Returns
- Task<bool>
Encrypt(Stream, Stream, Memory<byte>, Memory<byte>, ReadOnlyMemory<byte>)
public Task<bool> Encrypt(Stream plaintext, Stream output, Memory<byte> outPlaintextSHA256, Memory<byte> outCiphertextSHA256, ReadOnlyMemory<byte> encryptionKey)
Parameters
plaintext Stream
output Stream
outPlaintextSHA256 Memory<byte>
outCiphertextSHA256 Memory<byte>
encryptionKey ReadOnlyMemory<byte>
Returns
- Task<bool>