•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 426,529 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,834 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 8463 | Replies: 24
![]() |
•
•
Join Date: Feb 2005
Posts: 31
Reputation:
Rep Power: 4
Solved Threads: 0
Hi All,
Before i start asking for advice on this just a quick mention to comatose to say thank you for all your previous help. Cheers..
Also just to say i believe my problem i pm'd you about has been resolved.. (i need to be a little more carful, i sometime get a bit relaxed with my security)
HENCE this question...
OK, since my previous question i have been learning how to code using Windows Scripting Learning Guide (Stop laughing, we all had to start somewhere) and am becoming better with my abilities to code.. Not perfect but getting there..
So.. I have an idea that i would like to see if its possible to create a piece of code that will allow a user to input and password of there choice into a text box and in return it will retun a more secure version of the password.
For example:
Let say my password was "DINNER" i would like the program to start with a input box and ask "Please enter the password you wish to secure" then the user enters there password, for example DINNER. I would then like the code to come back wth a response to the password by somehow searching the words, numbers and symbols of a standard keyboard layout an retun something like "D¦NN34"
it doesnt have to be exactly that but it searches randomly for words or symbols that closly resemble the word input "D1NN3R" would also be acceptable or "|)!|V|V34"
Know believe me i dont for one minute think that this will be easy or remotley simple and i am not asking for this for any other reason except i am currently not up to this level of coding experience yet but in my line of work and due to the fact i my self got lazy and had to pay the price (thanks again for sorting that out coma) i feel this kind of a tool would be invaluable for me and my users in our organisation.
I would be most grateful for any words of advice/wisdom or for anyone who has created such a program to share there knowledge with me, or even better if someone already knows how to code such a program to write it for me/us here.
Thanks in advance and look forward to the responses...
Thanks eveyone
PHREAK aka "TE"
Before i start asking for advice on this just a quick mention to comatose to say thank you for all your previous help. Cheers..
Also just to say i believe my problem i pm'd you about has been resolved.. (i need to be a little more carful, i sometime get a bit relaxed with my security)
HENCE this question...
OK, since my previous question i have been learning how to code using Windows Scripting Learning Guide (Stop laughing, we all had to start somewhere) and am becoming better with my abilities to code.. Not perfect but getting there..
So.. I have an idea that i would like to see if its possible to create a piece of code that will allow a user to input and password of there choice into a text box and in return it will retun a more secure version of the password.
For example:
Let say my password was "DINNER" i would like the program to start with a input box and ask "Please enter the password you wish to secure" then the user enters there password, for example DINNER. I would then like the code to come back wth a response to the password by somehow searching the words, numbers and symbols of a standard keyboard layout an retun something like "D¦NN34"
it doesnt have to be exactly that but it searches randomly for words or symbols that closly resemble the word input "D1NN3R" would also be acceptable or "|)!|V|V34"
Know believe me i dont for one minute think that this will be easy or remotley simple and i am not asking for this for any other reason except i am currently not up to this level of coding experience yet but in my line of work and due to the fact i my self got lazy and had to pay the price (thanks again for sorting that out coma) i feel this kind of a tool would be invaluable for me and my users in our organisation.
I would be most grateful for any words of advice/wisdom or for anyone who has created such a program to share there knowledge with me, or even better if someone already knows how to code such a program to write it for me/us here.
Thanks in advance and look forward to the responses...
Thanks eveyone
PHREAK aka "TE"
•
•
Join Date: Mar 2005
Location: Phnom Penh, Cambodia
Posts: 410
Reputation:
Rep Power: 5
Solved Threads: 36
This isn't a complete code, however it is a good example for making it, I don't know any better way than one. If anyone have better way, please let me know.
Function passGen( password As String ) As String
Dim words(26, 3) As String
Dim strTemp As String
Dim intRnd As Integer
Dim result As String
' /* Assign Similar Values For 'A' */
words(0, 0) = "@"
words(0, 1) = "/\"
words(0, 2) = "A"
words(0, 3) = "A"
' /* Assign Similar Values For 'B' */
words(1, 0) = "8"
words(1, 1) = "|3"
words(1, 2) = "B"
words(1, 3) = "B"
' /* Assign Similar Values For 'C' */
words(2, 0) = "["
words(2, 1) = "("
words(2, 2) = "<"
words(2, 3) = "C"
' /* Assign Similar Values For 'D' */
words(3, 0) = "|}"
words(3, 1) = "|]"
words(3, 2) = "|)"
words(3, 3) = "D"
' /* What you need to do are assign all
' the similar of each letter of the alphabet
' like what i have example for you above */
Randomize
' /* start generate each character
' into secure character. */
For i = 1 To Len(password)
' /* store the current character
' that we try to convert */
strTemp = Mid(password, i, 1)
' // Random similar letter of alphabet
intRnd = Int(Rnd * 3)
' /* if it is a alphabet then
' we will replace it with similar string */
If UCase(strTemp) <> LCase(strTemp) Then
' /* start replace similar word into string */
result = result & words(Asc(UCase(strTemp)) - 65, intRnd)
Else
' /* if it isn't a alphabet
result = result & strTemp
End If
Next i
' /* return the result
passGen = result
End Function•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 108
•
•
Join Date: Feb 2005
Posts: 31
Reputation:
Rep Power: 4
Solved Threads: 0
hi,
Thanks for the advice there,
However by doing it this way would that not mean i would also have to include similar values for symbols and numbers aswell? because if someones password was "Dinner2" then it would need to recognise the number? Also what if they entered a password of "D¦nner" would that mean i need to add values for evey key character avaialble on a standard keyboard just incase they included it into there code?
If so is there a quick way of doin it? or a resource containing some of the similar variations for a standard keyboard layout that i could use as a guide or reference. (or just copy and paste) ;-)
Cheers again
Elise
Thanks for the advice there,
However by doing it this way would that not mean i would also have to include similar values for symbols and numbers aswell? because if someones password was "Dinner2" then it would need to recognise the number? Also what if they entered a password of "D¦nner" would that mean i need to add values for evey key character avaialble on a standard keyboard just incase they included it into there code?
If so is there a quick way of doin it? or a resource containing some of the similar variations for a standard keyboard layout that i could use as a guide or reference. (or just copy and paste) ;-)
Cheers again
Elise
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 108
Elise,
I'm A Soldier In The US Army, and we have army e-mail addresses. I rarely use it, but that isn't the point... my point is, that their is a standard restriction on how the password must be done for security reasons. That standard is that the password must contain 3 upper and 3 lower case characters, 2 "special characters" such as @#$%, and 4 numbers.
That said, I see No purpose, based on security reasons, for a need to change numbers, or special characters into anything else. If you really wanted to change the numbers into something else, then it would require the same concept that Visal coded above with the array. You'd have to increase the size of the array, to accept whatever numbers you want to catch, and change. Again though, my personal opinion is that special characters and numbers are pretty much secure enough to not need altering....
Another Thing To Consider, when using this script, is that most of the alterations that are made replace a single character with two characters. So, If A Password given by the user is "janetomandmatt", which is 14 characters, and M as translated to: /\/\, The password length, by just changing The First M, Is Now 18 characters long. If The Program that is requiring the password has a character cap of say 16 characters..... now what? Some programs will just truncate it.... (chop it off) so they could type the whole thing and it wouldn't matter, but some check the length, and if it's not right, it throws a fit. Anyway, let me know if I can help any more.
I'm A Soldier In The US Army, and we have army e-mail addresses. I rarely use it, but that isn't the point... my point is, that their is a standard restriction on how the password must be done for security reasons. That standard is that the password must contain 3 upper and 3 lower case characters, 2 "special characters" such as @#$%, and 4 numbers.
That said, I see No purpose, based on security reasons, for a need to change numbers, or special characters into anything else. If you really wanted to change the numbers into something else, then it would require the same concept that Visal coded above with the array. You'd have to increase the size of the array, to accept whatever numbers you want to catch, and change. Again though, my personal opinion is that special characters and numbers are pretty much secure enough to not need altering....
Another Thing To Consider, when using this script, is that most of the alterations that are made replace a single character with two characters. So, If A Password given by the user is "janetomandmatt", which is 14 characters, and M as translated to: /\/\, The password length, by just changing The First M, Is Now 18 characters long. If The Program that is requiring the password has a character cap of say 16 characters..... now what? Some programs will just truncate it.... (chop it off) so they could type the whole thing and it wouldn't matter, but some check the length, and if it's not right, it throws a fit. Anyway, let me know if I can help any more.
•
•
Join Date: Feb 2005
Posts: 31
Reputation:
Rep Power: 4
Solved Threads: 0
hi guys,
you right about the special characters not needing changing (silly me) otherwise it could change a secure password into a non secure.. (doh) as long as it recognises they are not to be changed and leaves them exactly in tact where they are.
well thats ok then il just need to create the a to z of variations of the letters which is great...
Im slightly confised as to what to do next though? do i need to do anything to the code to get it to randomaize etc or is this done in the code provided.
Again sorry for the inadiquecy but i i am trying... :-)
at the monent im currently (vb for dummys book) learning how to take info from the regestry etc so as much as i wish i could take this code and run with it unfortunelty i still pull up a black as to what to do next. i can add all the similar characters in for the rest of the alphabet and i know how to create a text box/input box but may require some help....
Cheers again guys..
you right about the special characters not needing changing (silly me) otherwise it could change a secure password into a non secure.. (doh) as long as it recognises they are not to be changed and leaves them exactly in tact where they are.
well thats ok then il just need to create the a to z of variations of the letters which is great...
Im slightly confised as to what to do next though? do i need to do anything to the code to get it to randomaize etc or is this done in the code provided.
Again sorry for the inadiquecy but i i am trying... :-)
at the monent im currently (vb for dummys book) learning how to take info from the regestry etc so as much as i wish i could take this code and run with it unfortunelty i still pull up a black as to what to do next. i can add all the similar characters in for the rest of the alphabet and i know how to create a text box/input box but may require some help....
Cheers again guys..
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 108
Ok.
The for loop For i = 1 To Len(password), says basically "for all the letters in their password", so, if their password is Dinner, it's going to loop 6 times. Since the value of "i" will change every time it loops (starting at one, and ending with [in this example] 6), this line strTemp = Mid(password, i, 1), basically starts at the very left, and gets the first letter of the password, then the second, then the third (it changes, since it uses i, with each "iteration" of the loop) So, strTemp will actually be 1 character, and it will move through the person's password, character by character. Then it does a randomize, because you'll notice there are 3 or 4 possibilities for each letter to be altered to. That way D isn't always |), it can be |] also, so we grab a random number within our "letter range" of the array. Then basically we maintain a variable that we just add our information to the end of. So the variable result just keeps getting more letters added to it as we figure them out. This function (with the exception of the missing letters, E-Z) is fully functional, and once you add the missing letters will work as it is
The for loop For i = 1 To Len(password), says basically "for all the letters in their password", so, if their password is Dinner, it's going to loop 6 times. Since the value of "i" will change every time it loops (starting at one, and ending with [in this example] 6), this line strTemp = Mid(password, i, 1), basically starts at the very left, and gets the first letter of the password, then the second, then the third (it changes, since it uses i, with each "iteration" of the loop) So, strTemp will actually be 1 character, and it will move through the person's password, character by character. Then it does a randomize, because you'll notice there are 3 or 4 possibilities for each letter to be altered to. That way D isn't always |), it can be |] also, so we grab a random number within our "letter range" of the array. Then basically we maintain a variable that we just add our information to the end of. So the variable result just keeps getting more letters added to it as we figure them out. This function (with the exception of the missing letters, E-Z) is fully functional, and once you add the missing letters will work as it is
•
•
Join Date: Feb 2005
Posts: 31
Reputation:
Rep Power: 4
Solved Threads: 0
Because i want it to include caps and lower case letters aswell will i need to put them (as in caps and lowewe case version of the letters) in to the variations part of the script as uppercase and a lower case letter for it to choose from? or just add the letter and if it picks it check it against alphabet to see if it IS a "A to Z" letter and if so randomly make it upper or lower case? or im i off my head????? ;-)
im working on the a to z bit now....... sill al ittle confused but ill do as much as i can now and get you updated... thanks aagain guys..
Cheers
:-)
im working on the a to z bit now....... sill al ittle confused but ill do as much as i can now and get you updated... thanks aagain guys..
Cheers
:-)
Last edited by Phreak : Jun 3rd, 2005 at 7:44 am. Reason: didnt read correctly
•
•
Join Date: Feb 2005
Posts: 31
Reputation:
Rep Power: 4
Solved Threads: 0
#9
Jun 3rd, 2005
additional...
ive completed the "A to Z" part of the script so now we have
ok so i'm up to there... what do i need to do now to get the script to run? Once its kind of running i think ill be able to ammend it from there on in.. i just dont think i am savvy enough with VB to get it up and running from this point on my own?
Cheers again
ive completed the "A to Z" part of the script so now we have
Function passGen( password As String ) As String
Dim words(26, 3) As String
Dim strTemp As String
Dim intRnd As Integer
Dim result As String
' /* Assign Similar Values For 'A' */
words(0, 0) = "@"
words(0, 1) = "/\"
words(0, 2) = "^"
words(0, 3) = "4"
to
' /* Assign Similar Values For 'Z' */
words(25, 0) = "Z"
words(25, 1) = "z"
words(25, 2) = "2"
words(25, 3) = "2"
' /* What you need to do are assign all
' the similar of each letter of the alphabet */
Randomize
' /* start generate each character
' into secure character. */
For i = 1 To Len(password)
' /* store the current character
' that we try to convert */
strTemp = Mid(password, i, 1)
' // Random similar letter of alphabet
intRnd = Int(Rnd * 3)
' /* if it is a alphabet then
' we will replace it with similar string */
If UCase(strTemp) <> LCase(strTemp) Then
' /* start replace similar word into string */
result = result & words(Asc(UCase(strTemp)) - 65, intRnd)
Else
' /* if it isn't a alphabet
result = result & strTemp
End If
Next i
' /* return the result
passGen = result
End Functionok so i'm up to there... what do i need to do now to get the script to run? Once its kind of running i think ill be able to ammend it from there on in.. i just dont think i am savvy enough with VB to get it up and running from this point on my own?
Cheers again
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 108
Well, it's a function, and can be used in VB or VBS. A Quick Breakdown, is that a function returns a value, so it would be something like this:
whatever.vbs:
Don't forget to modify the actual function (because it's not modified here) to contain A - Z characters (above just has A and Z)
whatever.vbs:
Dim Secure as string
UnSecure = inputbox("Enter Your Password")
Secure = passGen(UnSecure)
msgbox "Your Secure Password is: " & Secure
WScript.Quit
Function passGen( password As String ) As String
Dim words(26, 3) As String
Dim strTemp As String
Dim intRnd As Integer
Dim result As String
' /* Assign Similar Values For 'A' */
words(0, 0) = "@"
words(0, 1) = "/\"
words(0, 2) = "^"
words(0, 3) = "4"
' /* Assign Similar Values For 'Z' */
words(25, 0) = "Z"
words(25, 1) = "z"
words(25, 2) = "2"
words(25, 3) = "2"
' /* What you need to do are assign all
' the similar of each letter of the alphabet */
Randomize
' /* start generate each character
' into secure character. */
For i = 1 To Len(password)
' /* store the current character
' that we try to convert */
strTemp = Mid(password, i, 1)
' // Random similar letter of alphabet
intRnd = Int(Rnd * 3)
' /* if it is a alphabet then
' we will replace it with similar string */
If UCase(strTemp) <> LCase(strTemp) Then
' /* start replace similar word into string */
result = result & words(Asc(UCase(strTemp)) - 65, intRnd)
Else
' /* if it isn't a alphabet
result = result & strTemp
End If
Next i
' /* return the result
passGen = result
End FunctionDon't forget to modify the actual function (because it's not modified here) to contain A - Z characters (above just has A and Z)
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- password protecting (HTML and CSS)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Collecting Statistics from fields
- Next Thread: help on data type conversion



Linear Mode