Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Looking for an encryption method
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Looking for an encryption method

 Post Reply Post Reply
Author
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Topic: Looking for an encryption method
    Posted: 02 October 2004 at 6:25am
hi guys,

ive been searching the net, for 2 way encryption mothods for an application im working on.

i have 160 bit for the login password.

but i want to allow the clients of the application to encrypt the contact details, as there are telephone, fax, addresses etc.

does anyone know of any good website/ tutorials for 2 way encryption.
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: 02 October 2004 at 6:34am
If you are willing to use ASP.NET there are some built in 2 way encryption methods including DES, RSA and Triple DES. If you can use ASP.NET I can post a sample for you
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2004 at 6:42am
the client i am making the application for whats it done in asp, else i would have.

thanx for the suggestion though, i would like a copy anyway . good thing to have in the store (storage folder of scripts i have).
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: 02 October 2004 at 6:45am
Ok, here you are, you just need to change the 2 keys and Import System.Security.Cryptography and System.IO before using.


Private rgbKEY As Byte() = {12, 75, 31, 49, 55, 8, 250, 78, 66, 249, 1, 29, 2, 255, 124, 93, 6, 14, 75, 164, 75, 24, 73, 192}
Private rgbIV As Byte() = {89, 154, 106, 44, 67, 1, 164, 2, 78, 11, 83, 14, 245, 9, 22, 137, 130, 19, 197, 47, 75, 43, 111, 192}

Public Function TripleDESEncrypt(ByVal input As String) As String
If Not input Is Nothing Then
Dim objCryptoService As New TripleDESCryptoServiceProvider
Dim msCrypt As New MemoryStream
Dim csCrypt As New CryptoStream(msCrypt, objCryptoService.CreateEncryptor(rgbKEY, rgbIV), CryptoStreamMode.Write)
Dim swCrypt As New StreamWriter(csCrypt)

swCrypt.Write(input)
swCrypt.Flush()
msCrypt.Flush()
csCrypt.FlushFinalBlock()
Return Convert.ToBase64String(msCrypt.GetBuffer, 0, msCrypt.Length)
swCrypt.Close()
End If
End Function

Public Function TripleDESDecrypt(ByVal input As String) As String
If input <> Nothing Then
Dim cryptoProvider As New TripleDESCryptoServiceProvider
Dim buffer As Byte() = Convert.FromBase64String(input)
Dim ms As New MemoryStream(buffer)
Dim cs As New CryptoStream(ms, cryptoProvider.CreateDecryptor(rgbKEY, rgbIV), CryptoStreamMode.Read)
Dim sr As StreamReader = New StreamReader(cs)

Return sr.ReadToEnd()
End If
End Function



Edited by Mart
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2004 at 5:55pm
cheers,

 ill store that away, never know when it can be handy.

so does anyone else know away to do it with classic asp.

im searching but not finding to much.
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.