Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Encrypting a Password Before It is Added
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Encrypting a Password Before It is Added

 Post Reply Post Reply
Author
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Topic: Encrypting a Password Before It is Added
    Posted: 10 May 2005 at 3:15pm
I am trying to encrypt a password value before it is being added to the database. Can someone please help me with this?
 
I am currently getting the following error message:
 
Compiler Error Message: BC30451: Name 'EncryptIt' is not declared.

Source Error:

Line 215:                         objDataRow("Password") = System.DBNull.Value 
Line 216:                 else 
Line 217:                         objDataRow("Password") = EncryptIt(Password, strENCRYPTION_TYPE)  
Line 218:                 end if 
Here's some of my code:
 
dim Password as String
Password = txtPassword.Text
code that has an error:  'Set string values
if Password = "" then
objDataRow("Password") = System.DBNull.Value
else
objDataRow("Password") = EncryptIt(Password, strENCRYPTION_TYPE)
end if


Edited by Misty - 10 May 2005 at 3:15pm
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 2005 at 4:06pm
Well do you have a function called encrypt it? And if so have you imported the namespace it is in? I.e. if its in the namespace MyEncryption.CryptoStuff you need to put a

<%@ Import NameSpace="MyEncryption.CryptoStuff" %>

or

Imports MyEncryption.CryptoStuff

or

using MyEncryption.CryptoStuff;

where applicable
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 2005 at 4:07pm
Where is your EncryptIt Function located?
 
Try something like


Dim password as String = txtPassword.Text
 
If password="" or password = String.Empty THEN
   objDataRow("Password") = System.DBNull.Value
Else
  objDataRow("Password") = EncryptIt(Password, strEncryption_Type)
End If
 
Private Function EncryptIt(ByVal password as string, ByVal strEncryption_Type as EncType)
' Your encryption code here
Return encryptedPassword
End Function
 
Private Enum EncType
   MD5,
   SHA1,
   SHA256
End Enum
  
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2005 at 1:18am
Originally posted by Mart Mart wrote:

Well do you have a function called encrypt it? And if so have you imported the namespace it is in? I.e. if its in the namespace MyEncryption.CryptoStuff you need to put a

<%@ Import NameSpace="MyEncryption.CryptoStuff" %>

or

Imports MyEncryption.CryptoStuff

or

using MyEncryption.CryptoStuff;

where applicable
 
This didn't work. I got an error message when I used the name space above. I realized that I had forgotten to add a function. I added a function. It works fine now.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.