1

Currently I work on FTPS upload file program(console application c#) which will be deploy into client machine. As I able to encrypt the app config which contain private information, the only part I can't solve is where the decryption part on client machine which the process is fail. Is there any solution to solve this decryption on client machine? and I saw this site https://msdn.microsoft.com/library/f3022b39-f17f-48c1-b067-025eab0ce8bc which explain about import RSA key. but does it work on console application?

here is my app.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings configProtectionProvider="RsaProtectedConfigurationProvider">
<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>Rsa Key</KeyName>
      </KeyInfo>
      <CipherData>
        <CipherValue>SnwNpLDpZBo24v2wAlbwIj0WVOct0Rm8Tl95/4tCFeD7SCLpLq7s7At7taWd0uAhkWA24iRplLKen2mWX3Ys0gomJsE1POZAKk/tX/oITE0N3mbHWAbevZk0ZGNSQrlf4vlkNTVc0jhEvoxmRmWQvZNwKNqTaDA+IKvf5xdeC3w=</CipherValue>
      </CipherData>
    </EncryptedKey>
  </KeyInfo>
  <CipherData>
    <CipherValue>E+I8egRK6OUef73QTdI9T9qc/DAHo+n+V+Bc41nOYPgRdr8CeO0/hdIjEe5DAWVS+2EsH1kT+Mfl9EMhZEvWvxc4sMBjGI5WOIG3FYJ1rYnuxFvQxPJQte3Bdzxt8VKUE4ybU6wxxlV/wORHL+KuqLUSO9QHYmx82qqzhPPFoMokKla647CNEpr5ZyCO5zd5t7NH1tp3hHmlYH3Tt3FwEbgCr94ZxQtmqwnagpsZONbcyr0BXh+L+qfncYHy95kb6ZvtmYrMwPW2efYsxMJqeoyt68SWv33jG0xNcx36jrGv8DVCyyNQXnLDCXE6XMBCi7fteDOMA0A+PAp2EgUYd3OCLw1NIYr49S4Q/xSomGRmsOQpE69KijPBOe/aRWDhLrReVQnS4Pq+OvpoZmQLtS87YqwKk5XrETtzPLUiBLH+wxoksK1OQqKZskMI0UgDADoK/bRsNoc7USWMgNkKTxMuRP8cpApZoBBvhRZ8EkJk3Bo99aZWRH1UJGT5n8BdLcgenu2QDyMUZY1j5EdDaqF7RoyE7K/N</CipherValue>
  </CipherData>
</EncryptedData>

Jon doe
  • 11
  • 6
  • Hello @Jon doe, welcome to SO. Please share some code so you helps us helping you. Have you tried something yet? meaning.. have you tried to make it work on a console application? What was the problem with it? – rmjoia Sep 28 '17 at 06:22
  • hi @rmjoia, for now i able to encrypt and decrypt on the same machine. And what my objective is to use the program into other client machine. The problem during decryption is, the process didn't run like it suppose to run on local machine. – Jon doe Sep 28 '17 at 06:35
  • well, "the process didn't run like it suppose to run on local machine" doesn't help anyone understanding how to help you.. – rmjoia Sep 28 '17 at 06:39
  • alright @rmjoia , basically my program able to decrpyt the app.config that i encrypt inside my computer. When I try to use the program into other computer, the decrpytion fail. Since i store all the private data for FTPS connection inside the app.config. – Jon doe Sep 28 '17 at 06:42
  • And why cant you read the config data in the client machine? – rmjoia Sep 28 '17 at 06:43
  • basically might because i didn't have the RSA key container in client machine. but what i read it works only for web application, and the program that i do is a console application @rmjoia – Jon doe Sep 28 '17 at 06:46
  • does this help? [Encryption / Decryption of app.config sections using RsaProtectedConfigurationProvider](https://stackoverflow.com/questions/4256569/encryption-decryption-of-app-config-sections-using-rsaprotectedconfigurationpr) – rmjoia Sep 28 '17 at 06:49

0 Answers0