Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Core Encryption of DataCore Encryption of Data
Previous
 
Next
New Post
3/21/2007 3:06 PM
 
You'll notice that in IWEB I am using

strPassword = HttpUtility.UrlDecode(parmPassword)

So I suspect that you will want to UrlEncode before saving to the database and UrlDecode when retrieving from the database.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
3/21/2007 4:56 PM
 

I'll try that thanks!

This may be a little rudimentary, but what data type would you store it as in sql? varchar, binary,nvarchar, varbinary?

 
New Post
3/21/2007 6:33 PM
 

URLEncode/URLDecode did not seem to make any difference. The decrypt error still happens. I also changed the db fields to nvarchar(100), with no luck.

Public Function GetCustomer(ByVal customerId As Integer) As CustomerInfo

Dim customerInfo As New CustomerInfo
Dim Encrypter As New IWebEncryption()
customerInfo = CType(CBO.FillObject(DataProvider.Instance().GetCustomer(customerId), GetType(CustomerInfo)), CustomerInfo)

'Decode the data before Decryption
customerInfo.AccountNo = HttpUtility.UrlDecode(customerInfo.AccountNo)
customerInfo.CID = HttpUtility.UrlDecode(customerInfo.CID)
customerInfo.ExpDate = HttpUtility.UrlDecode(customerInfo.ExpDate)

'Decrypt
customerInfo.AccountNo = Encrypter.DeCrypt(customerInfo.AccountNo, _key)
customerInfo.CID = Encrypter.DeCrypt(customerInfo.CID, _key)
customerInfo.ExpDate = Encrypter.DeCrypt(customerInfo.ExpDate, _key)

Return customerInfo
End Function

 

Public Function AddCustomer(ByVal objCustomer As CustomerInfo) As Integer

Dim Encrypter As New IWebEncryption()

'Encrypt Data
objCustomer.AccountNo = Encrypter.Encryption(objCustomer.AccountNo, _key)
objCustomer.CID = Encrypter.Encryption(objCustomer.CID, _key)
objCustomer.ExpDate = Encrypter.Encryption(objCustomer.ExpDate, _key)

'Encode the data before entry into the DB
objCustomer.AccountNo = HttpUtility.UrlEncode(objCustomer.AccountNo)
objCustomer.CID = HttpUtility.UrlEncode(objCustomer.CID)
objCustomer.ExpDate = HttpUtility.UrlEncode(objCustomer.ExpDate)

Return DataProvider.Instance().AddCustomer(objCustomer.OrderId, _
objCustomer.CustomerFirstName, _
objCustomer.CustomerLastName, _
objCustomer.AccountType, _
objCustomer.AccountNo, _
objCustomer.CID, _
objCustomer.ExpDate)

End Function
 
New Post
3/21/2007 8:23 PM
 
I would use nvarchar because the encryption output uses unicode characters. However if you URLEncode it you may not need this so you could use varchar. I'm not sure.


Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Core Encryption of DataCore Encryption of Data


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out