SymmetricAlgorithm.EncryptEcb Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
EncryptEcb(Byte[], PaddingMode) |
Encrypts data using ECB mode with the specified padding mode. |
EncryptEcb(ReadOnlySpan<Byte>, PaddingMode) |
Encrypts data using ECB mode with the specified padding mode. |
EncryptEcb(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode) |
Encrypts data into the specified buffer, using ECB mode with the specified padding mode. |
EncryptEcb(Byte[], PaddingMode)
- Source:
- SymmetricAlgorithm.cs
- Source:
- SymmetricAlgorithm.cs
- Source:
- SymmetricAlgorithm.cs
Encrypts data using ECB mode with the specified padding mode.
public:
cli::array <System::Byte> ^ EncryptEcb(cli::array <System::Byte> ^ plaintext, System::Security::Cryptography::PaddingMode paddingMode);
public byte[] EncryptEcb (byte[] plaintext, System.Security.Cryptography.PaddingMode paddingMode);
member this.EncryptEcb : byte[] * System.Security.Cryptography.PaddingMode -> byte[]
Public Function EncryptEcb (plaintext As Byte(), paddingMode As PaddingMode) As Byte()
Parameters
- plaintext
- Byte[]
The data to encrypt.
- paddingMode
- PaddingMode
The padding mode used to produce the ciphertext and remove during decryption.
Returns
The encrypted ciphertext data.
Exceptions
plaintext
is null
.
paddingMode
is not a valid padding mode.
The plaintext could not be encrypted successfully.
Remarks
This method's behavior is defined by TryEncryptEcbCore(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32).
Applies to
EncryptEcb(ReadOnlySpan<Byte>, PaddingMode)
- Source:
- SymmetricAlgorithm.cs
- Source:
- SymmetricAlgorithm.cs
- Source:
- SymmetricAlgorithm.cs
Encrypts data using ECB mode with the specified padding mode.
public:
cli::array <System::Byte> ^ EncryptEcb(ReadOnlySpan<System::Byte> plaintext, System::Security::Cryptography::PaddingMode paddingMode);
public byte[] EncryptEcb (ReadOnlySpan<byte> plaintext, System.Security.Cryptography.PaddingMode paddingMode);
member this.EncryptEcb : ReadOnlySpan<byte> * System.Security.Cryptography.PaddingMode -> byte[]
Public Function EncryptEcb (plaintext As ReadOnlySpan(Of Byte), paddingMode As PaddingMode) As Byte()
Parameters
- plaintext
- ReadOnlySpan<Byte>
The data to encrypt.
- paddingMode
- PaddingMode
The padding mode used to produce the ciphertext and remove during decryption.
Returns
The encrypted ciphertext data.
Exceptions
paddingMode
is not a valid padding mode.
The plaintext could not be encrypted successfully.
Remarks
This method's behavior is defined by TryEncryptEcbCore(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32).
Applies to
EncryptEcb(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode)
- Source:
- SymmetricAlgorithm.cs
- Source:
- SymmetricAlgorithm.cs
- Source:
- SymmetricAlgorithm.cs
Encrypts data into the specified buffer, using ECB mode with the specified padding mode.
public:
int EncryptEcb(ReadOnlySpan<System::Byte> plaintext, Span<System::Byte> destination, System::Security::Cryptography::PaddingMode paddingMode);
public int EncryptEcb (ReadOnlySpan<byte> plaintext, Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode);
member this.EncryptEcb : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode -> int
Public Function EncryptEcb (plaintext As ReadOnlySpan(Of Byte), destination As Span(Of Byte), paddingMode As PaddingMode) As Integer
Parameters
- plaintext
- ReadOnlySpan<Byte>
The data to encrypt.
- paddingMode
- PaddingMode
The padding mode used to produce the ciphertext and remove during decryption.
Returns
The total number of bytes written to destination
.
Exceptions
paddingMode
is not a valid padding mode.
The plaintext could not be encrypted successfully.
The buffer in destination
is too small to hold the ciphertext data.
Remarks
This method's behavior is defined by TryEncryptEcbCore(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32).
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기