TripleDES クラス

定義

すべての TripleDES 実装の派生元となる Triple Data Encryption Standard アルゴリズムの基本クラスを表します。

public ref class TripleDES abstract : System::Security::Cryptography::SymmetricAlgorithm
public abstract class TripleDES : System.Security.Cryptography.SymmetricAlgorithm
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public abstract class TripleDES : System.Security.Cryptography.SymmetricAlgorithm
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class TripleDES : System.Security.Cryptography.SymmetricAlgorithm
type TripleDES = class
    inherit SymmetricAlgorithm
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type TripleDES = class
    inherit SymmetricAlgorithm
[<System.Runtime.InteropServices.ComVisible(true)>]
type TripleDES = class
    inherit SymmetricAlgorithm
Public MustInherit Class TripleDES
Inherits SymmetricAlgorithm
継承
派生
属性

次のコード例は、 TripleDES オブジェクトを作成して使用して、ファイル内のデータを暗号化および復号化する方法を示しています。

using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

class TripleDESSample
{
    static void Main()
    {
        try
        {
            byte[] key;
            byte[] iv;

            // Create a new TripleDES object to generate a random key
            // and initialization vector (IV).
            using (TripleDES tripleDes = TripleDES.Create())
            {
                key = tripleDes.Key;
                iv = tripleDes.IV;
            }

            // Create a string to encrypt.
            string original = "Here is some data to encrypt.";
            // The name/path of the file to write.
            string filename = "CText.enc";

            // Encrypt the string to a file.
            EncryptTextToFile(original, filename, key, iv);

            // Decrypt the file back to a string.
            string decrypted = DecryptTextFromFile(filename, key, iv);

            // Display the decrypted string to the console.
            Console.WriteLine(decrypted);
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }

    public static void EncryptTextToFile(string text, string path, byte[] key, byte[] iv)
    {
        try
        {
            // Create or open the specified file.
            using (FileStream fStream = File.Open(path, FileMode.Create))
            // Create a new TripleDES object.
            using (TripleDES tripleDes = TripleDES.Create())
            // Create a TripleDES encryptor from the key and IV
            using (ICryptoTransform encryptor = tripleDes.CreateEncryptor(key, iv))
            // Create a CryptoStream using the FileStream and encryptor
            using (var cStream = new CryptoStream(fStream, encryptor, CryptoStreamMode.Write))
            {
                // Convert the provided string to a byte array.
                byte[] toEncrypt = Encoding.UTF8.GetBytes(text);

                // Write the byte array to the crypto stream.
                cStream.Write(toEncrypt, 0, toEncrypt.Length);
            }
        }
        catch (CryptographicException e)
        {
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
            throw;
        }
    }

    public static string DecryptTextFromFile(string path, byte[] key, byte[] iv)
    {
        try
        {
            // Open the specified file
            using (FileStream fStream = File.OpenRead(path))
            // Create a new TripleDES object.
            using (TripleDES tripleDes = TripleDES.Create())
            // Create a TripleDES decryptor from the key and IV
            using (ICryptoTransform decryptor = tripleDes.CreateDecryptor(key, iv))
            // Create a CryptoStream using the FileStream and decryptor
            using (var cStream = new CryptoStream(fStream, decryptor, CryptoStreamMode.Read))
            // Create a StreamReader to turn the bytes back into text
            using (StreamReader reader = new StreamReader(cStream, Encoding.UTF8))
            {
                // Read back all of the text from the StreamReader, which receives
                // the decrypted bytes from the CryptoStream, which receives the
                // encrypted bytes from the FileStream.
                return reader.ReadToEnd();
            }
        }
        catch (CryptographicException e)
        {
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
            throw;
        }
    }
}
Imports System.IO
Imports System.Security.Cryptography
Imports System.Text

Module TripleDESSample

    Sub Main()
        Try
            Dim key As Byte()
            Dim iv As Byte()

            ' Create a new TripleDES object to generate a key
            ' and initialization vector (IV).
            Using tripleDes As TripleDES = TripleDES.Create
                key = tripleDes.Key
                iv = tripleDes.IV
            End Using

            ' Create a string to encrypt.
            Dim original As String = "Here is some data to encrypt."
            ' The name/path of the file to write.
            Dim filename As String = "CText.enc"

            ' Encrypt the string to a file.
            EncryptTextToFile(original, filename, key, iv)

            ' Decrypt the file back to a string.
            Dim decrypted As String = DecryptTextFromFile(filename, key, iv)

            ' Display the decrypted string to the console.
            Console.WriteLine(decrypted)
        Catch e As Exception
            Console.WriteLine(e.Message)
        End Try
    End Sub


    Sub EncryptTextToFile(text As String, path As String, key As Byte(), iv As Byte())
        Try
            ' Create or open the specified file.
            ' Create a new TripleDES object,
            ' Create a TripleDES encryptor from the key and IV,
            ' Create a CryptoStream using the MemoryStream And encryptor
            Using fStream As FileStream = File.Open(path, FileMode.Create),
                tripleDes As TripleDES = TripleDES.Create,
                encryptor As ICryptoTransform = tripleDes.CreateEncryptor(key, iv),
                cStream = New CryptoStream(fStream, encryptor, CryptoStreamMode.Write)

                ' Convert the passed string to a byte array.
                Dim toEncrypt As Byte() = Encoding.UTF8.GetBytes(text)

                ' Write the byte array to the crypto stream.
                cStream.Write(toEncrypt, 0, toEncrypt.Length)
            End Using

        Catch e As CryptographicException
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message)
            Throw
        End Try
    End Sub


    Function DecryptTextFromFile(path As String, key As Byte(), iv As Byte()) As String
        Try
            ' Open the specified file
            ' Create a new TripleDES object.
            ' Create a TripleDES decryptor from the key and IV
            ' Create a CryptoStream using the MemoryStream and decryptor
            ' Create a StreamReader to turn the bytes back into text
            Using mStream As FileStream = File.OpenRead(path),
                tripleDes As TripleDES = TripleDES.Create,
                decryptor As ICryptoTransform = tripleDes.CreateDecryptor(key, iv),
                cStream = New CryptoStream(mStream, decryptor, CryptoStreamMode.Read),
                reader = New StreamReader(cStream, Encoding.UTF8)

                ' Read back all of the text from the StreamReader, which receives
                ' the decrypted bytes from the CryptoStream, which receives the
                ' encrypted bytes from the FileStream.
                Return reader.ReadToEnd()
            End Using
        Catch e As CryptographicException
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message)
            Return Nothing
        End Try
    End Function
End Module

次のコード例は、 TripleDES オブジェクトを作成して使用して、メモリ内のデータを暗号化および復号化する方法を示しています。

using System;
using System.Security.Cryptography;
using System.Text;
using System.IO;

class TripleDESSample2
{
    static void Main()
    {
        try
        {
            byte[] key;
            byte[] iv;

            // Create a new TripleDES object to generate a random key
            // and initialization vector (IV).
            using (TripleDES tripleDes = TripleDES.Create())
            {
                key = tripleDes.Key;
                iv = tripleDes.IV;
            }

            // Create a string to encrypt.
            string original = "Here is some data to encrypt.";

            // Encrypt the string to an in-memory buffer.
            byte[] encrypted = EncryptTextToMemory(original, key, iv);

            // Decrypt the buffer back to a string.
            string decrypted = DecryptTextFromMemory(encrypted, key, iv);

            // Display the decrypted string to the console.
            Console.WriteLine(decrypted);
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }

    public static byte[] EncryptTextToMemory(string text, byte[] key, byte[] iv)
    {
        try
        {
            // Create a MemoryStream.
            using (MemoryStream mStream = new MemoryStream())
            {
                // Create a new TripleDES object.
                using (TripleDES tripleDes = TripleDES.Create())
                // Create a TripleDES encryptor from the key and IV
                using (ICryptoTransform encryptor = tripleDes.CreateEncryptor(key, iv))
                // Create a CryptoStream using the MemoryStream and encryptor
                using (var cStream = new CryptoStream(mStream, encryptor, CryptoStreamMode.Write))
                {
                    // Convert the provided string to a byte array.
                    byte[] toEncrypt = Encoding.UTF8.GetBytes(text);

                    // Write the byte array to the crypto stream and flush it.
                    cStream.Write(toEncrypt, 0, toEncrypt.Length);

                    // Ending the using statement for the CryptoStream completes the encryption.
                }

                // Get an array of bytes from the MemoryStream that holds the encrypted data.
                byte[] ret = mStream.ToArray();

                // Return the encrypted buffer.
                return ret;
            }
        }
        catch (CryptographicException e)
        {
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
            throw;
        }
    }

    public static string DecryptTextFromMemory(byte[] encrypted, byte[] key, byte[] iv)
    {
        try
        {
            // Create a buffer to hold the decrypted data.
            // TripleDES-encrypted data will always be slightly bigger than the decrypted data.
            byte[] decrypted = new byte[encrypted.Length];
            int offset = 0;

            // Create a new MemoryStream using the provided array of encrypted data.
            using (MemoryStream mStream = new MemoryStream(encrypted))
            {
                // Create a new TripleDES object.
                using (TripleDES tripleDes = TripleDES.Create())
                // Create a TripleDES decryptor from the key and IV
                using (ICryptoTransform decryptor = tripleDes.CreateDecryptor(key, iv))
                // Create a CryptoStream using the MemoryStream and decryptor
                using (var cStream = new CryptoStream(mStream, decryptor, CryptoStreamMode.Read))
                {
                    // Keep reading from the CryptoStream until it finishes (returns 0).
                    int read = 1;

                    while (read > 0)
                    {
                        read = cStream.Read(decrypted, offset, decrypted.Length - offset);
                        offset += read;
                    }
                }
            }

            // Convert the buffer into a string and return it.
            return Encoding.UTF8.GetString(decrypted, 0, offset);
        }
        catch (CryptographicException e)
        {
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
            throw;
        }
    }
}
Imports System.Security.Cryptography
Imports System.Text
Imports System.IO

Module MemorySample

    Sub Main()
        Try
            Dim key As Byte()
            Dim iv As Byte()

            ' Create a new TripleDES object to generate a key
            ' and initialization vector (IV).
            Using tripleDes As TripleDES = TripleDES.Create
                key = tripleDes.Key
                iv = tripleDes.IV
            End Using

            ' Create a string to encrypt.
            Dim original As String = "Here is some data to encrypt."

            ' Encrypt the string to an in-memory buffer.
            Dim encrypted As Byte() = EncryptTextToMemory(original, key, iv)

            ' Decrypt the buffer back to a string.
            Dim decrypted As String = DecryptTextFromMemory(encrypted, key, iv)

            ' Display the decrypted string to the console.
            Console.WriteLine(decrypted)
        Catch e As Exception
            Console.WriteLine(e.Message)
        End Try
    End Sub


    Function EncryptTextToMemory(text As String, key As Byte(), iv As Byte()) As Byte()
        Try
            ' Create a MemoryStream.
            Using mStream As New MemoryStream
                ' Create a new TripleDES object,
                ' Create a TripleDES encryptor from the key and IV,
                ' Create a CryptoStream using the MemoryStream And encryptor
                Using tripleDes As TripleDES = TripleDES.Create,
                    encryptor As ICryptoTransform = tripleDes.CreateEncryptor(key, iv),
                    cStream = New CryptoStream(mStream, encryptor, CryptoStreamMode.Write)

                    ' Convert the passed string to a byte array.
                    Dim toEncrypt As Byte() = Encoding.UTF8.GetBytes(text)

                    ' Write the byte array to the crypto stream and flush it.
                    cStream.Write(toEncrypt, 0, toEncrypt.Length)

                    ' Ending the using block for the CryptoStream completes the encryption.
                End Using

                ' Get an array of bytes from the MemoryStream that holds the encrypted data.
                Dim ret As Byte() = mStream.ToArray()

                ' Return the encrypted buffer.
                Return ret
            End Using
        Catch e As CryptographicException
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message)
            Throw
        End Try
    End Function


    Function DecryptTextFromMemory(encrypted As Byte(), key As Byte(), iv As Byte()) As String
        Try
            ' Create a buffer to hold the decrypted data.
            ' TripleDES-encrypted data will always be slightly bigger than the decrypted data.
            Dim decrypted(encrypted.Length - 1) As Byte
            Dim offset As Integer = 0

            ' Create a new MemoryStream using the provided array of encrypted data.
            ' Create a new TripleDES object.
            ' Create a TripleDES decryptor from the key and IV
            ' Create a CryptoStream using the MemoryStream and decryptor
            Using mStream As New MemoryStream(encrypted),
                tripleDes As TripleDES = TripleDES.Create,
                decryptor As ICryptoTransform = tripleDes.CreateDecryptor(key, iv),
                cStream = New CryptoStream(mStream, decryptor, CryptoStreamMode.Read)

                ' Keep reading from the CryptoStream until it finishes (returns 0).
                Dim read As Integer = 1

                While (read > 0)
                    read = cStream.Read(decrypted, offset, decrypted.Length - offset)
                    offset += read
                End While
            End Using

            ' Convert the buffer into a string and return it.
            Return New ASCIIEncoding().GetString(decrypted, 0, offset)
        Catch e As CryptographicException
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message)
            Return Nothing
        End Try
    End Function
End Module

注釈

TripleDES では、 DES アルゴリズムの 3 つの反復が使用されます。 2 つまたは 3 つの 56 ビット キーを使用できます。

Note

新しい対称暗号化アルゴリズムである Advanced Encryption Standard (AES) を使用できます。 Aes クラスではなく、TripleDES クラスとその派生クラスを使用することを検討してください。 TripleDESは、レガシ アプリケーションとデータとの互換性のためにのみ使用します。

このアルゴリズムは、128 ビットから 192 ビットまでのキー長を 64 ビットずつサポートします。

コンストラクター

名前 説明
TripleDES()

TripleDES クラスの新しいインスタンスを初期化します。

フィールド

名前 説明
BlockSizeValue

暗号化操作のブロック サイズをビット単位で表します。

(継承元 SymmetricAlgorithm)
FeedbackSizeValue

暗号化操作のフィードバック サイズをビット単位で表します。

(継承元 SymmetricAlgorithm)
IVValue

対称アルゴリズムの初期化ベクトル (IV) を表します。

(継承元 SymmetricAlgorithm)
KeySizeValue

対称アルゴリズムで使用される秘密鍵のサイズをビット単位で表します。

(継承元 SymmetricAlgorithm)
KeyValue

対称アルゴリズムの秘密鍵を表します。

(継承元 SymmetricAlgorithm)
LegalBlockSizesValue

対称アルゴリズムでサポートされるブロック サイズをビット単位で指定します。

(継承元 SymmetricAlgorithm)
LegalKeySizesValue

対称アルゴリズムでサポートされるキー サイズをビット単位で指定します。

(継承元 SymmetricAlgorithm)
ModeValue

対称アルゴリズムで使用される暗号モードを表します。

(継承元 SymmetricAlgorithm)
PaddingValue

対称アルゴリズムで使用されるパディング モードを表します。

(継承元 SymmetricAlgorithm)

プロパティ

名前 説明
BlockSize

暗号化操作のブロック サイズをビット単位で取得または設定します。

(継承元 SymmetricAlgorithm)
FeedbackSize

暗号フィードバック (CFB) および出力フィードバック (OFB) 暗号モードの暗号化操作のフィードバック サイズをビット単位で取得または設定します。

(継承元 SymmetricAlgorithm)
IV

対称アルゴリズムの初期化ベクトル (IV) を取得または設定します。

(継承元 SymmetricAlgorithm)
Key

TripleDES アルゴリズムの秘密鍵を取得または設定します。

KeySize

対称アルゴリズムで使用される秘密鍵のサイズをビット単位で取得または設定します。

(継承元 SymmetricAlgorithm)
LegalBlockSizes

対称アルゴリズムでサポートされているブロック サイズをビット単位で取得します。

LegalBlockSizes

対称アルゴリズムでサポートされているブロック サイズをビット単位で取得します。

(継承元 SymmetricAlgorithm)
LegalKeySizes

対称アルゴリズムでサポートされているキー サイズをビット単位で取得します。

LegalKeySizes

対称アルゴリズムでサポートされているキー サイズをビット単位で取得します。

(継承元 SymmetricAlgorithm)
Mode

対称アルゴリズムの操作モードを取得または設定します。

(継承元 SymmetricAlgorithm)
Padding

対称アルゴリズムで使用されるパディング モードを取得または設定します。

(継承元 SymmetricAlgorithm)

メソッド

名前 説明
Clear()

SymmetricAlgorithm クラスによって使用されるすべてのリソースを解放します。

(継承元 SymmetricAlgorithm)
Create()

TripleDES アルゴリズムを実行する暗号化オブジェクトのインスタンスを作成します。

Create(String)
古い.

TripleDES アルゴリズムの指定された実装を実行する暗号化オブジェクトのインスタンスを作成します。

CreateDecryptor()

現在の Key プロパティと初期化ベクトル (IV) を使用して対称復号化オブジェクトを作成します。

(継承元 SymmetricAlgorithm)
CreateDecryptor(Byte[], Byte[])

派生クラスでオーバーライドされた場合は、指定した Key プロパティと初期化ベクトル (IV) を使用して対称復号化オブジェクトを作成します。

(継承元 SymmetricAlgorithm)
CreateEncryptor()

現在の Key プロパティと初期化ベクトル (IV) を使用して対称暗号化オブジェクトを作成します。

(継承元 SymmetricAlgorithm)
CreateEncryptor(Byte[], Byte[])

派生クラスでオーバーライドされた場合は、指定した Key プロパティと初期化ベクトル (IV) を使用して対称暗号化オブジェクトを作成します。

(継承元 SymmetricAlgorithm)
DecryptCbc(Byte[], Byte[], PaddingMode)

指定した埋め込みモードで CBC モードを使用してデータを復号化します。

(継承元 SymmetricAlgorithm)
DecryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode)

指定した埋め込みモードで CBC モードを使用してデータを復号化します。

(継承元 SymmetricAlgorithm)
DecryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode)

指定したパディング モードで CBC モードを使用して、指定したバッファーにデータを復号化します。

(継承元 SymmetricAlgorithm)
DecryptCfb(Byte[], Byte[], PaddingMode, Int32)

指定された埋め込みモードとフィードバック サイズで CFB モードを使用してデータを復号化します。

(継承元 SymmetricAlgorithm)
DecryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode, Int32)

指定された埋め込みモードとフィードバック サイズで CFB モードを使用してデータを復号化します。

(継承元 SymmetricAlgorithm)
DecryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

指定したパディング モードとフィードバック サイズを持つ CFB モードを使用して、指定したバッファーにデータを復号化します。

(継承元 SymmetricAlgorithm)
DecryptEcb(Byte[], PaddingMode)

指定されたパディング モードで ECB モードを使用してデータを復号化します。

(継承元 SymmetricAlgorithm)
DecryptEcb(ReadOnlySpan<Byte>, PaddingMode)

指定されたパディング モードで ECB モードを使用してデータを復号化します。

(継承元 SymmetricAlgorithm)
DecryptEcb(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode)

指定したパディング モードで ECB モードを使用して、指定したバッファーにデータを復号化します。

(継承元 SymmetricAlgorithm)
Dispose()

SymmetricAlgorithm クラスの現在のインスタンスで使用されているすべてのリソースを解放します。

(継承元 SymmetricAlgorithm)
Dispose(Boolean)

SymmetricAlgorithmによって使用されるアンマネージ リソースを解放し、必要に応じてマネージド リソースを解放します。

(継承元 SymmetricAlgorithm)
EncryptCbc(Byte[], Byte[], PaddingMode)

指定したパディング モードで CBC モードを使用してデータを暗号化します。

(継承元 SymmetricAlgorithm)
EncryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode)

指定したパディング モードで CBC モードを使用してデータを暗号化します。

(継承元 SymmetricAlgorithm)
EncryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode)

指定したパディング モードで CBC モードを使用して、指定したバッファーにデータを暗号化します。

(継承元 SymmetricAlgorithm)
EncryptCfb(Byte[], Byte[], PaddingMode, Int32)

指定されたパディング モードとフィードバック サイズで CFB モードを使用してデータを暗号化します。

(継承元 SymmetricAlgorithm)
EncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode, Int32)

指定されたパディング モードとフィードバック サイズで CFB モードを使用してデータを暗号化します。

(継承元 SymmetricAlgorithm)
EncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

指定した埋め込みモードとフィードバック サイズで CFB モードを使用して、指定したバッファーにデータを暗号化します。

(継承元 SymmetricAlgorithm)
EncryptEcb(Byte[], PaddingMode)

指定された埋め込みモードで ECB モードを使用してデータを暗号化します。

(継承元 SymmetricAlgorithm)
EncryptEcb(ReadOnlySpan<Byte>, PaddingMode)

指定された埋め込みモードで ECB モードを使用してデータを暗号化します。

(継承元 SymmetricAlgorithm)
EncryptEcb(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode)

指定したパディング モードで ECB モードを使用して、指定したバッファーにデータを暗号化します。

(継承元 SymmetricAlgorithm)
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GenerateIV()

派生クラスでオーバーライドされると、アルゴリズムに使用するランダムな初期化ベクトル (IV) が生成されます。

(継承元 SymmetricAlgorithm)
GenerateKey()

派生クラスでオーバーライドされると、アルゴリズムに使用するランダム キー (Key) が生成されます。

(継承元 SymmetricAlgorithm)
GetCiphertextLengthCbc(Int32, PaddingMode)

指定されたパディング モードと CBC モードのプレーンテキストの長さを持つ暗号テキストの長さを取得します。

(継承元 SymmetricAlgorithm)
GetCiphertextLengthCfb(Int32, PaddingMode, Int32)

指定された埋め込みモードと CFB モードのプレーンテキスト長を持つ暗号テキストの長さを取得します。

(継承元 SymmetricAlgorithm)
GetCiphertextLengthEcb(Int32, PaddingMode)

指定されたパディング モードと ECB モードのプレーンテキスト長を持つ暗号テキストの長さを取得します。

(継承元 SymmetricAlgorithm)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsWeakKey(Byte[])

指定したキーが弱いかどうかを判断します。

MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
SetKey(ReadOnlySpan<Byte>)

このインスタンスのキーを設定します。

(継承元 SymmetricAlgorithm)
SetKeyCore(ReadOnlySpan<Byte>)

このインスタンスのキーを設定します。

(継承元 SymmetricAlgorithm)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
TryDecryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Int32, PaddingMode)

指定したパディング モードで CBC モードを使用して、指定したバッファーにデータの暗号化を解除しようとします。

(継承元 SymmetricAlgorithm)
TryDecryptCbcCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

派生クラスでオーバーライドされると、指定したパディング モードで CBC モードを使用して、指定したバッファーにデータの暗号化を解除しようとします。

(継承元 SymmetricAlgorithm)
TryDecryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Int32, PaddingMode, Int32)

指定したパディング モードとフィードバック サイズを持つ CFB モードを使用して、指定したバッファーにデータの暗号化を解除しようとします。

(継承元 SymmetricAlgorithm)
TryDecryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32)

派生クラスでオーバーライドされると、指定したパディング モードとフィードバック サイズの CFB モードを使用して、指定したバッファーにデータを復号化しようとします。

(継承元 SymmetricAlgorithm)
TryDecryptEcb(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

指定したパディング モードで ECB モードを使用して、指定したバッファーにデータの復号化を試みます。

(継承元 SymmetricAlgorithm)
TryDecryptEcbCore(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

派生クラスでオーバーライドされると、指定したパディング モードで ECB モードを使用して、指定したバッファーにデータの暗号化を解除しようとします。

(継承元 SymmetricAlgorithm)
TryEncryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Int32, PaddingMode)

指定したパディング モードで CBC モードを使用して、指定したバッファーにデータを暗号化しようとします。

(継承元 SymmetricAlgorithm)
TryEncryptCbcCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

派生クラスでオーバーライドされると、指定したパディング モードで CBC モードを使用して、指定したバッファーにデータを暗号化しようとします。

(継承元 SymmetricAlgorithm)
TryEncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Int32, PaddingMode, Int32)

指定したパディング モードとフィードバック サイズを持つ CFB モードを使用して、指定したバッファーにデータを暗号化しようとします。

(継承元 SymmetricAlgorithm)
TryEncryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32)

派生クラスでオーバーライドされると、指定したパディング モードとフィードバック サイズの CFB モードを使用して、指定したバッファーにデータを暗号化しようとします。

(継承元 SymmetricAlgorithm)
TryEncryptEcb(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

指定したパディング モードで ECB モードを使用して、指定したバッファーにデータを暗号化しようとします。

(継承元 SymmetricAlgorithm)
TryEncryptEcbCore(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

派生クラスでオーバーライドされると、指定したパディング モードで ECB モードを使用して、指定したバッファーにデータを暗号化しようとします。

(継承元 SymmetricAlgorithm)
ValidKeySize(Int32)

指定したキー サイズが現在のアルゴリズムに対して有効かどうかを判断します。

(継承元 SymmetricAlgorithm)

明示的なインターフェイスの実装

名前 説明
IDisposable.Dispose()

この API は製品インフラストラクチャをサポートします。コードから直接使用するものではありません。

SymmetricAlgorithmによって使用されるアンマネージ リソースを解放し、必要に応じてマネージド リソースを解放します。

(継承元 SymmetricAlgorithm)

適用対象

こちらもご覧ください