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
2/15/2007 6:11 PM
 

Can the core encryption scheme be used to encrypt/decrypt custom module data? I am building a module that will contain sensitve account information and I would like to encrypt in the database table.

1. Can the core encryption scheme be used?
2. What is used as a key? Can I specify a custom key, like CustomerId?
3. Should by database data type be binary, varchar, ntext...etc?

Thanks for any information provided,this is my first module that contains sensitive info.

 
New Post
2/15/2007 6:27 PM
 
I’d recommend using your own encryption implementation based on .Net best practices. If you use your own implantation you’ll have one less dependency on the DNN core.

Qualtiy DotNetNuke modules and custom development; we've been serving the DNN community for over 2 years and have hundreds of satisfied customers. Let us serve you today.
 
New Post
2/15/2007 10:58 PM
 

In the IWeb module, there is a encryption/dycryption method (you can download it and use the code)

Public Function Encryption(ByVal UnEncryptedData As String, ByVal Key As String) As String

Public Function DeCrypt(ByVal EncryptedData As String, ByVal Key As String) As String

You just toss it a string and a key. It uses Rijndael encryption which is true .Net "managed code". The other .Net encryption methods are "wrappers" around COM components. 



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
2/16/2007 9:10 AM
 
Thank you Michael, I'll check that out.
 
New Post
3/21/2007 2:12 PM
 

Michael -

I had some mixed results with using the IWeb encryption methods. The encrypt part works well, but the decryption always throws an error:

DotNetNuke.Services.Exceptions.ModuleLoadException: Length of the data to decrypt is invalid. ---> System.Security.Cryptography.CryptographicException: Length of the data to decrypt is invalid. at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at MNO.Modules.SOMS.Symmetric.Decrypt(cryptData encryptedcryptData)

This is how I'm calling it in the Controller Class:

<DataObjectMethod(DataObjectMethodType.Select)> _
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)
   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

 
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