Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 4th, 2006, 05:49 AM
Registered User
 
Join Date: Aug 2006
Location: mumbai, maharashtra, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default encrypting and decrypting money field in c#

can any one help me in encrypting & decrypting my database using c#

In my database i hv a field name Money its data type is money.
I want to encrypt this field while records are inserted.
I am able to encrypt all the text fields except this.
I am using asp.net c# with sql server 2000.
  #2 (permalink)  
Old August 7th, 2006, 12:31 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

what do you mean by encrypting money filed. Please explain

Regards
Ganesh
http://ganeshprof.blogspot.com
  #3 (permalink)  
Old August 7th, 2006, 02:57 AM
Registered User
 
Join Date: Aug 2006
Location: mumbai, maharashtra, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by r_ganesh76
 what do you mean by encrypting money filed. Please explain

Regards
Ganesh
http://ganeshprof.blogspot.com
in my database i hv a field name Money whoes data type is money.
I want to encrypt this field while records are inserted.
I am able to encrypt all the text fields except this.
I am using asp.net c# with sql server 2000.

  #4 (permalink)  
Old August 8th, 2006, 07:12 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I am going to assume that when you take the value, say $120.58, and encrypt it to a string (MD5, SHA, RSA, Base64, etc) SQL is probably telling you something like this:

"String value [encrypted string] cannot be inserted into column money of type money; Insert fails."

What you will have to do is change your column type from Money to Nvarchar to store that information because, at the point you encrypt the information, it is no longer "money" it is an encrypted string.

Hth.

"The one language all programmers understand is profanity."
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decrypting pgp files with vbscript tonyromero99 VBScript 4 June 4th, 2008 04:09 AM
Bad data when decrypting using RSA scotthcw ASP.NET 2.0 Basics 0 December 8th, 2006 11:10 PM
DECRYPTING Data? Thagi ASP.NET 1.x and 2.0 Application Design 1 March 28th, 2006 05:46 PM
problem decrypting bluelaser General .NET 0 October 10th, 2004 10:18 AM
Encrypting and Decrypting chipset VB How-To 0 July 27th, 2004 07:36 AM



All times are GMT -4. The time now is 07:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.