XML 암호화

XML(Extensible Markup Language) 암호화는 W3C(World Wide Web Consortium)가 2002년에 개발한 스펙으로, 데이터 암호화 단계, 암호화된 데이터를 복호화하는 단계, 암호화된 XML 데이터를 표현하기 위한 구문, 데이터를 복호화하는 데 사용되는 정보 및 세 개의 DES(Data Encryption Standard), AES(Advanced Encryption Standard), RSA(Rivest-Shamir-Adleman algorithm)와 같은 암호화 알고리즘 목록이 포함되어 있습니다.

중요사항: 버전 5.x와 버전 6 이상 애플리케이션 간에는 중요한 차이가 있습니다. 정보는 WebSphere® Application Server 6.0.x 이상 버전과 함께 사용되는 버전 5.x 애플리케이션만을 지원합니다. 버전 6.0.x 이상의 애플리케이션에는 이 정보가 적용되지 않습니다.

You can apply XML encryption to an XML element, XML element content, and arbitrary data, including an XML document. For example, suppose that you need to encrypt the <CreditCard> element shown in the example 1.

예 1: 샘플 XML 문서

<PaymentInfo xmlns='http://example.org/paymentv2'>
  <Name>John Smith</Name>
  <CreditCard Limit='5,000' Currency='USD'>
    <Number>4019 2445 0277 5567</Number>
    <Issuer>Example Bank</Issuer>
    <Expiration>04/02</Expiration>
  </CreditCard>
</PaymentInfo>

예 2: 공통 비밀 키가 포함된 XML 문서:

예 2는 암호화 후의 XML 문서를 보여줍니다. <EncryptedData> 요소는 암호화된 <CreditCard> 요소를 나타냅니다. <EncryptionMethod> 요소는 이 예제에서 삼중 DES인 적용된 암호화 알고리즘을 설명합니다. <KeyInfo> 요소에는 이 예제에서 <KeyName> 요소인 복호화 키를 검색하는 정보가 들어 있습니다. <CipherValue> 요소에는 <CreditCard> 요소를 직렬화하고 암호화하여 확보한 암호문이 들어 있습니다.

<PaymentInfo xmlns='http://example.org/paymentv2'>
  <Name>John Smith</Name>
  <EncryptedData Type='http://www.w3.org/2001/04/xmlenc#Element'
     xmlns='http://www.w3.org/2001/04/xmlenc#'>
    <EncryptionMethod
       Algorithm='http://www.w3.org/2001/04/xmlenc#tripledes-cbc'/>
       <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
         <KeyName>John Smith</KeyName>
       </KeyInfo>
       <CipherData>
         <CipherValue>ydUNqHkMrD...</CipherValue>
       </CipherData>
  </EncryptedData>
</PaymentInfo>

예 3: 수신인의 공개 키를 사용하여 암호화된 XML 문서:

예 2에서 전송자와 수신인 모두 공통 비밀 키를 가지고 있다고 가정합니다. 수신인이 일반적인 경우처럼 공개 및 개인 키 쌍을 가지고 있는 경우, <CreditCard> 요소는 예 3과 같이 암호화할 수 있습니다. <EncryptedData>요소는 예 2에 있는 <EncryptedData> 요소와 같습니다. 그러나 <KeyInfo> 요소에는 EncryptedKey가 들어 있습니다.

<PaymentInfo xmlns='http://example.org/paymentv2'>
  <Name>John Smith</Name>
  <EncryptedData Type='http://www.w3.org/2001/04/xmlenc#Element'
    xmlns='http://www.w3.org/2001/04/xmlenc#'>
    <EncryptionMethod
      Algorithm='http://www.w3.org/2001/04/xmlenc#tripledes-cbc'/>
    <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
      <EncryptedKey xmlns='http://www.w3.org/2001/04/xmlenc#'>
        <EncryptionMethod 
          Algorithm='http://www.w3.org/2001/04/xmlenc#rsa-1_5'/>
        <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
          <KeyName>Sally Doe</KeyName>
        </KeyInfo>
        <CipherData>
          <CipherValue>yMTEyOTA1M...</CipherValue>
        </CipherData>
      </EncryptedKey>
    </KeyInfo>
    <CipherData>
      <CipherValue>ydUNqHkMrD...</CipherValue>
    </CipherData>
  </EncryptedData>
</PaymentInfo>

WSS-Core에서의 XML 암호화:

WSS-Core 스펙은 OASIS(Organization for the Advancement of Structured Information Standards)에서 개발 중입니다. 스펙에서는 메시지 무결성, 메시지 기밀성, 단일 메시지 인증을 통해 보안 품질을 제공하는 SOAP 메시징에 대한 개선사항을 설명합니다. 메시지 신뢰성은 XML 암호화에 기반한 암호화에 의해 실현됩니다.

WSS-Core 스펙은 SOAP 메시지의 본문 블록, 헤더 블록, 하위 구조 및 첨부 파일의 모든 조합의 암호화를 지원합니다. 스펙은 또한 SOAP 메시지 파트를 암호화할 때 보안 헤더 블록의 참조를 메시지의 암호화된 파트에 추가하도록 요청합니다. 참조는 수신인에게 복호화하는 메시지의 암호화된 파트를 식별하는 단서가 될 수 있습니다.

참조의 XML 구문은 암호화된 정보 및 암호화 방법에 따라 다양합니다. 예를 들어, 예제 4의 <CreditCard> 요소가 공통 비밀 키 또는 수신인의 공개 키를 사용하여 암호화되었다고 가정하십시오.

예 4: 샘플 SOAP 메시지:

<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
  xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
  <SOAP-ENV:Body>
    <PaymentInfo xmlns='http://example.org/paymentv2'>
      <Name>John Smith</Name>
      <CreditCard Limit='5,000' Currency='USD'>
        <Number>4019 2445 0277 5567</Number>
        <Issuer>Example Bank</Issuer>
        <Expiration>04/02</Expiration>
      </CreditCard>
    </PaymentInfo>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

결과 SOAP 메시지는 예 5와 6에 나와 있습니다. 이러한 예에서 <ReferenceList> 및 <EncryptedKey> 요소는 각각 참조로 사용됩니다.

예 5: 공통 비밀 키로 암호화된 SOAP 메시지:

<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
  xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
  <SOAP-ENV:Header>
    <Security SOAP-ENV:mustUnderstand='1'
      xmlns='http://schemas.xmlsoap.org/ws/2003/06/secext'>
      <ReferenceList xmlns='http://www.w3.org/2001/04/xmlenc#'>
        <DataReference URI='#ed1'/>
      </ReferenceList>
    </Security>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <PaymentInfo xmlns='http://example.org/paymentv2'>
      <Name>John Smith</Name>
      <EncryptedData Id='ed1'
        Type='http://www.w3.org/2001/04/xmlenc#Element'
        xmlns='http://www.w3.org/2001/04/xmlenc#'>
        <EncryptionMethod
          Algorithm='http://www.w3.org/2001/04/xmlenc#tripledes-cbc'/>
        <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
          <KeyName>John Smith</KeyName>
        </KeyInfo>
        <CipherData>
          <CipherValue>ydUNqHkMrD...</CipherValue>
        </CipherData>
      </EncryptedData>
    </PaymentInfo>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

예 6: 수신인의 공개 키로 암호화된 SOAP 메시지:

<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
  xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
  <SOAP-ENV:Header>
    <Security SOAP-ENV:mustUnderstand='1'
      xmlns='http://schemas.xmlsoap.org/ws/2003/06/secext'>
      <EncryptedKey xmlns='http://www.w3.org/2001/04/xmlenc#'>
        <EncryptionMethod 
          Algorithm='http://www.w3.org/2001/04/xmlenc#rsa-1_5'/>
        <KeyInfo xmlns='http://www.w3.org/2000/09/xmldsig#'>
          <KeyName>Sally Doe</KeyName>
        </KeyInfo>
        <CipherData>
          <CipherValue>yMTEyOTA1M...</CipherValue>
        </CipherData>
        <ReferenceList>
          <DataReference URI='#ed1'/>
        </ReferenceList>
      </EncryptedKey>
    </Security>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <PaymentInfo xmlns='http://example.org/paymentv2'>
      <Name>John Smith</Name>
      <EncryptedData Id='ed1'
        Type='http://www.w3.org/2001/04/xmlenc#Element'
        xmlns='http://www.w3.org/2001/04/xmlenc#'>
        <EncryptionMethod
          Algorithm='http://www.w3.org/2001/04/xmlenc#tripledes-cbc'/>
        <CipherData>
          <CipherValue>ydUNqHkMrD...</CipherValue>
        </CipherData>
      </EncryptedData>
    </PaymentInfo>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

디지털 서명과의 관계:

WSS-Core 스펙에서는 XML 서명 스펙에 기반한 디지털 서명으로 구현된 메시지 무결성도 제공합니다.

공통 데이터를 통한 암호화 및 디지털 서명의 조합은 암호화의 취약점이 있습니다.


주제 유형을 표시하는 아이콘 개념 주제



시간소인 아이콘 마지막 업데이트 날짜: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=cwbs_encrypt
파일 이름:cwbs_encrypt.html