Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  XML Module [Lea...  Decrypt Function
Previous Previous
 
Next Next
New Post 10/12/2006 4:03 AM
User is offline Sonal Panwar
1 posts
10th Ranked


Decrypt Function 

Hi,

I am using DNN's Encrypt and Decrypt functions. I'll explain my scenario: I have an id field which is first encrypted on a page and then this value is decrypted on another page.This id is a part of the url so its encrypted but when i replace  the encrypted value in the url with id value directly then also it works,which should not happen.What I mean is that the Decrypt function is not working properly. It returns the same value as given to it in the same way as it returns the encrypted value, i.e when i give the id directly then it should not return that id, rather it should return a value only for an encrypted value. I dont know the reason for this? Either I m going wrong somewhere or I am missing something. Any help??

Regards,

Sonal

 

 

 
New Post 10/15/2006 7:33 AM
User is offline Stefan Cullmann
1431 posts
6th Ranked








Re: Decrypt Function 
 sonal wrote

Hi,

I am using DNN's Encrypt and Decrypt functions. I'll explain my scenario: I have an id field which is first encrypted on a page and then this value is decrypted on another page.This id is a part of the url so its encrypted but when i replace  the encrypted value in the url with id value directly then also it works,which should not happen.What I mean is that the Decrypt function is not working properly. It returns the same value as given to it in the same way as it returns the encrypted value, i.e when i give the id directly then it should not return that id, rather it should return a value only for an encrypted value. I dont know the reason for this? Either I m going wrong somewhere or I am missing something. Any help??

Regards,

Sonal

Sonal, this is the wrong forum. I would like to advise using the developing forum instead. Nevertheless your question made me curious, so I played some few minutes to catch the answer.
Inside the decrypt function the input will be converted from base64 to a byteArray, if this method fails the fuction will return the original input string:

' convert data to byte array and Base64 decode
Dim byteData(strData.Length) As Byte
Try
  
byteData = Convert.FromBase64String(strData)
Catch ' invalid length
   strValue = strData
End Try

So the behaviour is by design. If you want to deny unencryted ids in your url, you can write code like:

dim id as string = decrypt(key, input_ID)
if id=input_id then ...'(throw exception)

 

 


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com

forms & Lists (UDT5.0) will be the next major release of the User Defined Table project.
A first Preview is available, though it requires DotnetNuke 5 (Beta 5).

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  XML Module [Lea...  Decrypt Function
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DeutschNetNuke = DotNetNuke in German
DeutschNetNuke provides all DotNetNuke related services in German (and English).
www.DeutschNetNuke.de
The Standard in Senior Housing Information
SNAPforSeniors provides consumers with free online resources to assist them with their search for senior housing
www.snapforseniors.com
DotNetNuke Web Hosting w/ ASP.NET 3.5
Unlimited email boxes, Unlimited databases, Unlimited domains. Plans start at $4.97
www.MyWinHosting.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP