Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Combining a string and hex value
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Combining a string and hex value

 Post Reply Post Reply Page  12>
Author
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Topic: Combining a string and hex value
    Posted: 07 October 2003 at 1:27pm
Does anyone know of a good way to combine the value "examplepasssword" with "2A1A35FC" so that the values are totally mixed?
Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2003 at 3:04am

The following piece of code will mix them in a predictable way (I presume this is what you wanted since it appears that the two values are a password and a salt value, so it needs to be the same for each time you check it). Note that if one string is longer than the other, then not all the characters of the longer string will be used; I suggest you generate a salt value the same length as the password.

strPassword = StrReverse(strPassword)

Do Until Len(strPassword) = 0 Or Len(strSalt) = 0
 strOutput = strOutput & Left(strPassword, 1) & Right(strSalt, 1)
 strPassword = StrReverse(Right(strPassword, Len(strPassword) - 1))
 strSalt = StrReverse(Left(strSalt, Len(strSalt) - 1))
Loop

This code turned "examplepasssword" and "2A1A35FCE1494AFB" into "dBe2rFxAoAa1w4mAs9p3s4l5s1eFaEpC".

Hope this helps,
Blair

Webmaster, The Plane Gallery
Greetings From Christchurch
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2003 at 4:18pm

it needs to always return the same value with the same password and salt in order for it to work.

Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2003 at 8:54pm

The code I posted before will do what you want then.

Blair

Webmaster, The Plane Gallery
Greetings From Christchurch
Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2003 at 5:11am
ooh, i thought we were gonna get into some bit shifting and stuff then.  Those were the days...
There have been many, many posts made throughout the world...
This was one of them.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2003 at 1:14pm
i'm thinking of pre-encrypting my salt and password together so my encryption component i'm designing is as secure as possible...
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2003 at 1:26pm
just so you know... i can't generate a salt value with the same length as the password. If a hacker gets a hold of the database, it'll save him/her a lot of work.
Back to Top
Coco Brown View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2002
Location: United States
Status: Offline
Points: 245
Post Options Post Options   Thanks (0) Thanks(0)   Quote Coco Brown Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2003 at 1:59pm

Do a Google search on "rc4 encryption" for ASP.  Someone posted some ASP code implementing this.  It's two way, so you can use the same function to decrypt it.  It's pretty difficult to crack if used correctly. The key will have to be something that is not stored in the database and that the user can remember.

I hope this helps. 

Back to Top
 Post Reply Post Reply Page  12>

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.