muhaznwifey 0 Newbie Poster

Hello I need help encrypting just the password from a XML file. The file follows the W3C XML syntax. I think I can achieve it by by encrypting the xml element content like this example:

<?xml version='1.0'?> 
  <PaymentInfo xmlns='http://example.org/paymentv2'>
    <Name>John Smith</Name>
    <CreditCard Limit='5,000' Currency='USD'>
      <Number>
        <EncryptedData xmlns='http://www.w3.org/2001/04/xmlenc#'
         Type='http://www.w3.org/2001/04/xmlenc#Content'>
          <CipherData>
            <CipherValue>A23B45C56</CipherValue>
          </CipherData>
        </EncryptedData>
      </Number>
      <Issuer>Example Bank</Issuer>
      <Expiration>04/02</Expiration>
    </CreditCard>
  </PaymentInfo>

But I do not know how to encrypt my password. I have been searching on the internet for days and do not understand how I can encrypt the password. This xml file is the settings for an application from a vendor and will need to go on a sftp server. I just want to make sure if I encrypt the password it will work once its loaded on the server. Here is a sample of my code:

<?xml version="1.0"?>
<Application
  <Settings>
    <EmailAddress> 'test@test.com' </EmailAddress>
    <EmailAddressReplyTo> test@test.com </EmailAddressReplyTo>
    <Password>
    <EncryptedData xmlns='http://www.w3.org/2001/04/xmlenc#'
         Type='http://www.w3.org/2001/04/xmlenc#Content'>
    <CipherData>
                <CipherValue></CipherValue> --Password is !Sn0p5t@n!12 Note: This is not the realpassword. Just posting an example for help--
    </CipherData>
    </EncryptedData> 
    <FilePath>File.csv</FilePath>
    </Password>
    <Token></Token>
  </Settings>
</Application>

Please help!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.