Encryption - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.


Last post 05-14-2010 03:22 PM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-13-2010 07:07 AM


    I have an online web form that when submitted dumps into a SQLDB. I have created an InfoPath template that connects to that DB with all the associated fields. I have one query field (application date).

     When I query the date all applications that were submittted come in correctly. This is where I am stuck-

     One of the fields on the form is SSN- When the web form is submitted to the DB the SSN is encrypted. When I query the application date-all the data comes in but the SSN comes in encrypted.

     How do I get the SSN converted back to what was typed in on the form. I have read to use custom code but I am new to InfoPath so where does it go or can someone point me to an article explaining how to do this?



  • 05-13-2010 09:22 AM In reply to

    Decrypting will require knowledge of how the SSN was originally encrypted. Do you have access to the code that the web application uses to encrypt the SSN? Or can the developer for that application tell you how the information is encrypted?

    You will need to use code to decrypt. You can find information on this at sites like StackOverflow, which may help you get started.

    Hilary Stoupa

  • 05-13-2010 09:29 AM In reply to

    Yes I have the code

  • 05-13-2010 02:55 PM In reply to

    Great! How is the SSN being encrypted?

    Hilary Stoupa

  • 05-14-2010 05:22 AM In reply to

    Its is being done with a SSL cert on the web server.

     I have the code to decrypt and it works but this is the issue.

    I created the InfoPath form via connection to the SQL DB on another server. Once the form was linked I have the Query and Mydata fields. I created the entire form with only one query field (Application Date). When I look at the SQL Statement it is like this (abbreviated).

     select "EmpLName","EmpFName","EmpMI","AppDate"," ApplicationID","SSN_Encrypt" from "dbo"."Tablename" as "Tablename"

    I tried doing this-

    OPEN SYMMETRIC KEY "Keyname" (no quotes)

       DECRYPTION BY CERTIFICATE "Certname"; (no quotes)

    select "EmpLName","EmpFName","EmpMI","AppDate"," ApplicationID","

        CONVERT(char, DecryptByKey(keyname))

        AS 'SSN'

        FROM dbo.Tablenamee"  as "Tablename"

    What this does is take away my query field. It becomes unbound and I only have MyData fields avaiable in the datasource section. The run query cmd button works and the SSN comes in correctly but It brings in all applications submitted to the DB.

    I need to be able to query on the appdate.


    Hope this helps


  • 05-14-2010 03:22 PM In reply to

    I think you may need to alter your query statement in code prior to running it. It seems to me that you are instead altering the SQL statement for the main data connection. Here's an MSDN page that may help.

    Hilary Stoupa

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.