TripleDESCryptoServiceProvider 클래스

정의

주의

Derived cryptographic types are obsolete. Use the Create method on the base type instead.

래퍼 개체를 정의하여 TripleDES 알고리즘의 CSP(암호화 서비스 공급자) 버전에 액세스합니다. 이 클래스는 상속될 수 없습니다.

public ref class TripleDESCryptoServiceProvider sealed : System::Security::Cryptography::TripleDES
public sealed class TripleDESCryptoServiceProvider : System.Security.Cryptography.TripleDES
[System.Obsolete("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId="SYSLIB0021", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class TripleDESCryptoServiceProvider : System.Security.Cryptography.TripleDES
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class TripleDESCryptoServiceProvider : System.Security.Cryptography.TripleDES
type TripleDESCryptoServiceProvider = class
    inherit TripleDES
[<System.Obsolete("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId="SYSLIB0021", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type TripleDESCryptoServiceProvider = class
    inherit TripleDES
[<System.Runtime.InteropServices.ComVisible(true)>]
type TripleDESCryptoServiceProvider = class
    inherit TripleDES
Public NotInheritable Class TripleDESCryptoServiceProvider
Inherits TripleDES
상속
TripleDESCryptoServiceProvider
특성

예제

다음 코드 예제에서는 개체를 TripleDESCryptoServiceProvider 만들고 이를 사용하여 파일의 데이터를 암호화하고 암호 해독합니다.

using namespace System;
using namespace System::Security::Cryptography;
using namespace System::Text;
using namespace System::IO;
void EncryptTextToFile( String^ Data, String^ FileName, array<Byte>^Key, array<Byte>^IV )
{
   try
   {
      
      // Create or open the specified file.
      FileStream^ fStream = File::Open( FileName, FileMode::OpenOrCreate );
      
      // Create a CryptoStream using the FileStream 
      // and the passed key and initialization vector (IV).
      CryptoStream^ cStream = gcnew CryptoStream( fStream,(gcnew TripleDESCryptoServiceProvider)->CreateEncryptor( Key, IV ),CryptoStreamMode::Write );
      
      // Create a StreamWriter using the CryptoStream.
      StreamWriter^ sWriter = gcnew StreamWriter( cStream );
      
      // Write the data to the stream 
      // to encrypt it.
      sWriter->WriteLine( Data );
      
      // Close the streams and
      // close the file.
      sWriter->Close();
      cStream->Close();
      fStream->Close();
   }
   catch ( CryptographicException^ e ) 
   {
      Console::WriteLine( "A Cryptographic error occurred: {0}", e->Message );
   }
   catch ( UnauthorizedAccessException^ e ) 
   {
      Console::WriteLine( "A file access error occurred: {0}", e->Message );
   }

}

String^ DecryptTextFromFile( String^ FileName, array<Byte>^Key, array<Byte>^IV )
{
   try
   {
      
      // Create or open the specified file. 
      FileStream^ fStream = File::Open( FileName, FileMode::OpenOrCreate );
      
      // Create a CryptoStream using the FileStream 
      // and the passed key and initialization vector (IV).
      CryptoStream^ cStream = gcnew CryptoStream( fStream,(gcnew TripleDESCryptoServiceProvider)->CreateDecryptor( Key, IV ),CryptoStreamMode::Read );
      
      // Create a StreamReader using the CryptoStream.
      StreamReader^ sReader = gcnew StreamReader( cStream );
      
      // Read the data from the stream 
      // to decrypt it.
      String^ val = sReader->ReadLine();
      
      // Close the streams and
      // close the file.
      sReader->Close();
      cStream->Close();
      fStream->Close();
      
      // Return the string. 
      return val;
   }
   catch ( CryptographicException^ e ) 
   {
      Console::WriteLine( "A Cryptographic error occurred: {0}", e->Message );
      return nullptr;
   }
   catch ( UnauthorizedAccessException^ e ) 
   {
      Console::WriteLine( "A file access error occurred: {0}", e->Message );
      return nullptr;
   }

}

int main()
{
   try
   {
      
      // Create a new TripleDESCryptoServiceProvider object
      // to generate a key and initialization vector (IV).
      TripleDESCryptoServiceProvider^ tDESalg = gcnew TripleDESCryptoServiceProvider;
      
      // Create a string to encrypt.
      String^ sData = "Here is some data to encrypt.";
      String^ FileName = "CText.txt";
      
      // Encrypt text to a file using the file name, key, and IV.
      EncryptTextToFile( sData, FileName, tDESalg->Key, tDESalg->IV );
      
      // Decrypt the text from a file using the file name, key, and IV.
      String^ Final = DecryptTextFromFile( FileName, tDESalg->Key, tDESalg->IV );
      
      // Display the decrypted string to the console.
      Console::WriteLine( Final );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( e->Message );
   }

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

class TrippleDESCSPSample
{

    static void Main()
    {
        try
        {
            // Create a new TripleDESCryptoServiceProvider object
            // to generate a key and initialization vector (IV).
            TripleDESCryptoServiceProvider tDESalg = new TripleDESCryptoServiceProvider();

            // Create a string to encrypt.
            string sData = "Here is some data to encrypt.";
            string FileName = "CText.txt";

            // Encrypt text to a file using the file name, key, and IV.
            EncryptTextToFile(sData, FileName, tDESalg.Key, tDESalg.IV);

            // Decrypt the text from a file using the file name, key, and IV.
            string Final = DecryptTextFromFile(FileName, tDESalg.Key, tDESalg.IV);

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

    public static void EncryptTextToFile(String Data, String FileName, byte[] Key, byte[] IV)
    {
        try
        {
            // Create or open the specified file.
            FileStream fStream = File.Open(FileName,FileMode.OpenOrCreate);

            // Create a CryptoStream using the FileStream
            // and the passed key and initialization vector (IV).
            CryptoStream cStream = new CryptoStream(fStream,
                new TripleDESCryptoServiceProvider().CreateEncryptor(Key,IV),
                CryptoStreamMode.Write);

            // Create a StreamWriter using the CryptoStream.
            StreamWriter sWriter = new StreamWriter(cStream);

            // Write the data to the stream
            // to encrypt it.
            sWriter.WriteLine(Data);

            // Close the streams and
            // close the file.
            sWriter.Close();
            cStream.Close();
            fStream.Close();
        }
        catch(CryptographicException e)
        {
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
        }
        catch(UnauthorizedAccessException  e)
        {
            Console.WriteLine("A file access error occurred: {0}", e.Message);
        }
    }

    public static string DecryptTextFromFile(String FileName, byte[] Key, byte[] IV)
    {
        try
        {
            // Create or open the specified file.
            FileStream fStream = File.Open(FileName, FileMode.OpenOrCreate);

            // Create a CryptoStream using the FileStream
            // and the passed key and initialization vector (IV).
            CryptoStream cStream = new CryptoStream(fStream,
                new TripleDESCryptoServiceProvider().CreateDecryptor(Key,IV),
                CryptoStreamMode.Read);

            // Create a StreamReader using the CryptoStream.
            StreamReader sReader = new StreamReader(cStream);

            // Read the data from the stream
            // to decrypt it.
            string val = sReader.ReadLine();

            // Close the streams and
            // close the file.
            sReader.Close();
            cStream.Close();
            fStream.Close();

            // Return the string.
            return val;
        }
        catch(CryptographicException e)
        {
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message);
            return null;
        }
        catch(UnauthorizedAccessException  e)
        {
            Console.WriteLine("A file access error occurred: {0}", e.Message);
            return null;
        }
    }
}
Imports System.Security.Cryptography
Imports System.Text
Imports System.IO

Module TrippleDESCSPSample

    Sub Main()
        Try
            ' Create a new TripleDESCryptoServiceProvider object
            ' to generate a key and initialization vector (IV).
            Dim tDESalg As New TripleDESCryptoServiceProvider

            ' Create a string to encrypt.
            Dim sData As String = "Here is some data to encrypt."
            Dim FileName As String = "CText.txt"

            ' Encrypt text to a file using the file name, key, and IV.
            EncryptTextToFile(sData, FileName, tDESalg.Key, tDESalg.IV)

            ' Decrypt the text from a file using the file name, key, and IV.
            Dim Final As String = DecryptTextFromFile(FileName, tDESalg.Key, tDESalg.IV)

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


    Sub EncryptTextToFile(ByVal Data As String, ByVal FileName As String, ByVal Key() As Byte, ByVal IV() As Byte)
        Try
            ' Create or open the specified file.
            Dim fStream As FileStream = File.Open(FileName, FileMode.OpenOrCreate)

            ' Create a CryptoStream using the FileStream 
            ' and the passed key and initialization vector (IV).
            Dim cStream As New CryptoStream(fStream, _
                                            New TripleDESCryptoServiceProvider().CreateEncryptor(Key, IV), _
                                            CryptoStreamMode.Write)

            ' Create a StreamWriter using the CryptoStream.
            Dim sWriter As New StreamWriter(cStream)

            ' Write the data to the stream 
            ' to encrypt it.
            sWriter.WriteLine(Data)

            ' Close the streams and
            ' close the file.
            sWriter.Close()
            cStream.Close()
            fStream.Close()
        Catch e As CryptographicException
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message)
        Catch e As UnauthorizedAccessException
            Console.WriteLine("A file error occurred: {0}", e.Message)
        End Try
    End Sub


    Function DecryptTextFromFile(ByVal FileName As String, ByVal Key() As Byte, ByVal IV() As Byte) As String
        Try
            ' Create or open the specified file. 
            Dim fStream As FileStream = File.Open(FileName, FileMode.OpenOrCreate)

            ' Create a CryptoStream using the FileStream 
            ' and the passed key and initialization vector (IV).
            Dim cStream As New CryptoStream(fStream, _
                                            New TripleDESCryptoServiceProvider().CreateDecryptor(Key, IV), _
                                            CryptoStreamMode.Read)

            ' Create a StreamReader using the CryptoStream.
            Dim sReader As New StreamReader(cStream)

            ' Read the data from the stream 
            ' to decrypt it.
            Dim val As String = sReader.ReadLine()

            ' Close the streams and
            ' close the file.
            sReader.Close()
            cStream.Close()
            fStream.Close()

            ' Return the string. 
            Return val
        Catch e As CryptographicException
            Console.WriteLine("A Cryptographic error occurred: {0}", e.Message)
            Return Nothing
        Catch e As UnauthorizedAccessException
            Console.WriteLine("A file error occurred: {0}", e.Message)
            Return Nothing
        End Try
    End Function
End Module

다음 코드 예제에서는 개체를 TripleDESCryptoServiceProvider 만들고 이를 사용하여 메모리의 데이터를 암호화하고 암호 해독합니다.

using namespace System;
using namespace System::Security::Cryptography;
using namespace System::Text;
using namespace System::IO;
array<Byte>^ EncryptTextToMemory( String^ Data, array<Byte>^Key, array<Byte>^IV )
{
   try
   {
      
      // Create a MemoryStream.
      MemoryStream^ mStream = gcnew MemoryStream;
      
      // Create a CryptoStream using the MemoryStream 
      // and the passed key and initialization vector (IV).
      CryptoStream^ cStream = gcnew CryptoStream( mStream,(gcnew TripleDESCryptoServiceProvider)->CreateEncryptor( Key, IV ),CryptoStreamMode::Write );
      
      // Convert the passed string to a byte array.
      array<Byte>^toEncrypt = (gcnew ASCIIEncoding)->GetBytes( Data );
      
      // Write the byte array to the crypto stream and flush it.
      cStream->Write( toEncrypt, 0, toEncrypt->Length );
      cStream->FlushFinalBlock();
      
      // Get an array of bytes from the 
      // MemoryStream that holds the 
      // encrypted data.
      array<Byte>^ret = mStream->ToArray();
      
      // Close the streams.
      cStream->Close();
      mStream->Close();
      
      // Return the encrypted buffer.
      return ret;
   }
   catch ( CryptographicException^ e ) 
   {
      Console::WriteLine( "A Cryptographic error occurred: {0}", e->Message );
      return nullptr;
   }

}

String^ DecryptTextFromMemory( array<Byte>^Data, array<Byte>^Key, array<Byte>^IV )
{
   try
   {
      
      // Create a new MemoryStream using the passed 
      // array of encrypted data.
      MemoryStream^ msDecrypt = gcnew MemoryStream( Data );
      
      // Create a CryptoStream using the MemoryStream 
      // and the passed key and initialization vector (IV).
      CryptoStream^ csDecrypt = gcnew CryptoStream( msDecrypt,(gcnew TripleDESCryptoServiceProvider)->CreateDecryptor( Key, IV ),CryptoStreamMode::Read );
      
      // Create buffer to hold the decrypted data.
      array<Byte>^fromEncrypt = gcnew array<Byte>(Data->Length);
      
      // Read the decrypted data out of the crypto stream
      // and place it into the temporary buffer.
      csDecrypt->Read( fromEncrypt, 0, fromEncrypt->Length );
      
      //Convert the buffer into a string and return it.
      return (gcnew ASCIIEncoding)->GetString( fromEncrypt );
   }
   catch ( CryptographicException^ e ) 
   {
      Console::WriteLine( "A Cryptographic error occurred: {0}", e->Message );
      return nullptr;
   }

}

int main()
{
   try
   {
      
      // Create a new TripleDESCryptoServiceProvider object
      // to generate a key and initialization vector (IV).
      TripleDESCryptoServiceProvider^ tDESalg = gcnew TripleDESCryptoServiceProvider;
      
      // Create a string to encrypt.
      String^ sData = "Here is some data to encrypt.";
      
      // Encrypt the string to an in-memory buffer.
      array<Byte>^Data = EncryptTextToMemory( sData, tDESalg->Key, tDESalg->IV );
      
      // Decrypt the buffer back to a string.
      String^ Final = DecryptTextFromMemory( Data, tDESalg->Key, tDESalg->IV );
      
      // Display the decrypted string to the console.
      Console::WriteLine( Final );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( e->Message );
   }

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

class TrippleDESCSPSample
{

    static void Main()
    {
        try
        {
            // Create a new TripleDESCryptoServiceProvider object
            // to generate a key and initialization vector (IV).
            TripleDESCryptoServiceProvider tDESalg = new TripleDESCryptoServiceProvider();

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

            // Encrypt the string to an in-memory buffer.
            byte[] Data = EncryptTextToMemory(sData, tDESalg.Key, tDESalg.IV);

            // Decrypt the buffer back to a string.
            string Final = DecryptTextFromMemory(Data, tDESalg.Key, tDESalg.IV);

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

    public static byte[] EncryptTextToMemory(string Data,  byte[] Key, byte[] IV)
    {
        try
        {
            // Create a MemoryStream.
            MemoryStream mStream = new MemoryStream();

            // Create a CryptoStream using the MemoryStream
            // and the passed key and initialization vector (IV).
            CryptoStream cStream = new CryptoStream(mStream,
                new TripleDESCryptoServiceProvider().CreateEncryptor(Key, IV),
                CryptoStreamMode.Write);

            // Convert the passed string to a byte array.
            byte[] toEncrypt = new ASCIIEncoding().GetBytes(Data);

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

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

            // Close the streams.
            cStream.Close();
            mStream.Close();

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

    public static string DecryptTextFromMemory(byte[] Data,  byte[] Key, byte[] IV)
    {
        try
        {
            // Create a new MemoryStream using the passed
            // array of encrypted data.
            MemoryStream msDecrypt = new MemoryStream(Data);

            // Create a CryptoStream using the MemoryStream
            // and the passed key and initialization vector (IV).
            CryptoStream csDecrypt = new CryptoStream(msDecrypt,
                new TripleDESCryptoServiceProvider().CreateDecryptor(Key, IV),
                CryptoStreamMode.Read);

            // Create buffer to hold the decrypted data.
            byte[] fromEncrypt = new byte[Data.Length];

            // Read the decrypted data out of the crypto stream
            // and place it into the temporary buffer.
            csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length);

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

Module TrippleDESCSPSample

    Sub Main()
        Try
            ' Create a new TripleDESCryptoServiceProvider object
            ' to generate a key and initialization vector (IV).
            Dim tDESalg As New TripleDESCryptoServiceProvider

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

            ' Encrypt the string to an in-memory buffer.
            Dim Data As Byte() = EncryptTextToMemory(sData, tDESalg.Key, tDESalg.IV)

            ' Decrypt the buffer back to a string.
            Dim Final As String = DecryptTextFromMemory(Data, tDESalg.Key, tDESalg.IV)

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


    Function EncryptTextToMemory(ByVal Data As String, ByVal Key() As Byte, ByVal IV() As Byte) As Byte()
        Try
            ' Create a MemoryStream.
            Dim mStream As New MemoryStream

            ' Create a CryptoStream using the MemoryStream 
            ' and the passed key and initialization vector (IV).
            Dim cStream As New CryptoStream(mStream, _
                                            New TripleDESCryptoServiceProvider().CreateEncryptor(Key, IV), _
                                            CryptoStreamMode.Write)

            ' Convert the passed string to a byte array.
            Dim toEncrypt As Byte() = New ASCIIEncoding().GetBytes(Data)

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

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

            ' Close the streams.
            cStream.Close()
            mStream.Close()

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


    Function DecryptTextFromMemory(ByVal Data() As Byte, ByVal Key() As Byte, ByVal IV() As Byte) As String
        Try
            ' Create a new MemoryStream using the passed 
            ' array of encrypted data.
            Dim msDecrypt As New MemoryStream(Data)

            ' Create a CryptoStream using the MemoryStream 
            ' and the passed key and initialization vector (IV).
            Dim csDecrypt As New CryptoStream(msDecrypt, _
                                              New TripleDESCryptoServiceProvider().CreateDecryptor(Key, IV), _
                                              CryptoStreamMode.Read)

            ' Create buffer to hold the decrypted data.
            Dim fromEncrypt(Data.Length - 1) As Byte

            ' Read the decrypted data out of the crypto stream
            ' and place it into the temporary buffer.
            csDecrypt.Read(fromEncrypt, 0, fromEncrypt.Length)

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

설명

이 알고리즘은 128비트에서 192비트까지의 키 길이를 64비트 단위로 지원합니다.

참고

최신 대칭 암호화 알고리즘인 AES(Advanced Encryption Standard)를 사용할 수 있습니다. 클래스 대신 클래스를 사용하는 AesCryptoServiceProvider 것이 좋습니다 TripleDESCryptoServiceProvider . 사용 하 여 TripleDESCryptoServiceProvider 레거시 애플리케이션 및 데이터를 사용 하 여 호환성을 위해서만 합니다.

생성자

TripleDESCryptoServiceProvider()

TripleDESCryptoServiceProvider 클래스의 새 인스턴스를 초기화합니다.

필드

BlockSizeValue

암호화 작업의 블록 크기(비트)를 나타냅니다.

(다음에서 상속됨 SymmetricAlgorithm)
FeedbackSizeValue

암호화 작업의 피드백 크기(비트 단위)를 나타냅니다.

(다음에서 상속됨 SymmetricAlgorithm)
IVValue

대칭 알고리즘에 대한 초기화 벡터(IV)를 나타냅니다.

(다음에서 상속됨 SymmetricAlgorithm)
KeySizeValue

대칭 알고리즘에서 사용하는 비밀 키의 크기(비트 단위)를 나타냅니다.

(다음에서 상속됨 SymmetricAlgorithm)
KeyValue

대칭 알고리즘에 대한 비밀 키를 나타냅니다.

(다음에서 상속됨 SymmetricAlgorithm)
LegalBlockSizesValue

대칭 알고리즘에서 지원하는 블록 크기(비트 단위)를 지정합니다.

(다음에서 상속됨 SymmetricAlgorithm)
LegalKeySizesValue

대칭 알고리즘에서 지원하는 키 크기(비트 단위)를 지정합니다.

(다음에서 상속됨 SymmetricAlgorithm)
ModeValue

대칭 알고리즘에 사용된 암호화 모드를 나타냅니다.

(다음에서 상속됨 SymmetricAlgorithm)
PaddingValue

대칭 알고리즘에 사용된 패딩 모드를 나타냅니다.

(다음에서 상속됨 SymmetricAlgorithm)

속성

BlockSize

암호화 작업의 블록 크기(비트 단위)를 가져오거나 설정합니다.

BlockSize

암호화 작업의 블록 크기(비트 단위)를 가져오거나 설정합니다.

(다음에서 상속됨 SymmetricAlgorithm)
FeedbackSize

CFB(Cipher Feedback) 및 OFB(Output Feedback) 암호화 모드에 대한 암호화 작업의 피드백 크기(비트 단위)를 가져오거나 설정합니다.

FeedbackSize

CFB(Cipher Feedback) 및 OFB(Output Feedback) 암호화 모드에 대한 암호화 작업의 피드백 크기(비트 단위)를 가져오거나 설정합니다.

(다음에서 상속됨 SymmetricAlgorithm)
IV

대칭 알고리즘에 대한 초기화 벡터(IV)를 가져오거나 설정합니다.

IV

대칭 알고리즘에 대한 초기화 벡터(IV)를 가져오거나 설정합니다.

(다음에서 상속됨 SymmetricAlgorithm)
Key

TripleDES 알고리즘에 대한 비밀 키를 가져오거나 설정합니다.

Key

TripleDES 알고리즘에 대한 비밀 키를 가져오거나 설정합니다.

(다음에서 상속됨 TripleDES)
KeySize

비밀 키의 크기를 비트 단위로 가져오거나 설정합니다.

KeySize

대칭 알고리즘에서 사용하는 비밀 키의 크기(비트 단위)를 가져오거나 설정합니다.

(다음에서 상속됨 SymmetricAlgorithm)
LegalBlockSizes

대칭 알고리즘에서 지원하는 블록 크기(비트 단위)를 가져옵니다.

LegalBlockSizes

대칭 알고리즘에서 지원하는 블록 크기(비트 단위)를 가져옵니다.

(다음에서 상속됨 TripleDES)
LegalKeySizes

대칭 알고리즘에서 지원하는 키 크기(비트 단위)를 가져옵니다.

LegalKeySizes

대칭 알고리즘에서 지원하는 키 크기(비트 단위)를 가져옵니다.

(다음에서 상속됨 TripleDES)
Mode

대칭 알고리즘의 작업 모드를 가져오거나 설정합니다.

Mode

대칭 알고리즘의 작업 모드를 가져오거나 설정합니다.

(다음에서 상속됨 SymmetricAlgorithm)
Padding

대칭 알고리즘에 사용된 패딩 모드를 가져오거나 설정합니다.

Padding

대칭 알고리즘에 사용된 패딩 모드를 가져오거나 설정합니다.

(다음에서 상속됨 SymmetricAlgorithm)

메서드

Clear()

SymmetricAlgorithm 클래스에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 SymmetricAlgorithm)
CreateDecryptor()

현재 Key 속성 및 초기화 벡터(IV)를 사용하여 대칭 decryptor 개체를 만듭니다.

CreateDecryptor()

현재 Key 속성 및 초기화 벡터(IV)를 사용하여 대칭 decryptor 개체를 만듭니다.

(다음에서 상속됨 SymmetricAlgorithm)
CreateDecryptor(Byte[], Byte[])

지정된 키(Key)와 초기화 벡터(IV)를 사용하여 대칭 TripleDES 암호 해독기 개체를 만듭니다.

CreateEncryptor()

현재 Key 속성 및 초기화 벡터(IV)를 사용하여 대칭 encryptor 개체를 만듭니다.

CreateEncryptor()

현재 Key 속성 및 초기화 벡터(IV)를 사용하여 대칭 encryptor 개체를 만듭니다.

(다음에서 상속됨 SymmetricAlgorithm)
CreateEncryptor(Byte[], Byte[])

지정된 키(TripleDES)와 초기화 벡터(Key)를 사용하여 대칭 IV encryptor 개체를 만듭니다.

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)를 생성합니다.

GenerateKey()

알고리즘에 사용할 임의의 Key를 생성합니다.

GetCiphertextLengthCbc(Int32, PaddingMode)

CBC 모드에서 지정된 패딩 모드 및 일반 텍스트 길이가 있는 암호 텍스트의 길이를 가져옵니다.

(다음에서 상속됨 SymmetricAlgorithm)
GetCiphertextLengthCfb(Int32, PaddingMode, Int32)

CFB 모드에서 지정된 패딩 모드 및 일반 텍스트 길이가 있는 암호 텍스트의 길이를 가져옵니다.

(다음에서 상속됨 SymmetricAlgorithm)
GetCiphertextLengthEcb(Int32, PaddingMode)

ECB 모드에서 지정된 패딩 모드 및 일반 텍스트 길이가 있는 암호 텍스트의 길이를 가져옵니다.

(다음에서 상속됨 SymmetricAlgorithm)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
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)

적용 대상

추가 정보