• Status: Solved
• Priority: Medium
• Security: Public
• Views: 214

I'm looking for a encryption where the encrypted string is in the range A to z. We want to encrypt the customers name as a kind of license code. All the normal encryption function give some characters which are in the high ascii numbers.
0
dgb
1 Solution

Network Technician  & ProgrammerCommented:
Create an algorithm to convert customer name into a big number.  Convert the number base to 52, decode as 0=A, 51=z.

0

Commented:
0

Commented:
This does what you want,it is a simple replacement algoritm
it in fact is the german war-time 'enigma' system
since it is for a pasword no decoding is needed
but if you want decoding just pre/append 1 more character to the encoded string, this character beeing the encoding alphabet used
ie: 'A' for alphabet(1)...'z' for alphabet(52)

Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 3
Print sEncode("pierrecampe", i)
Next
End Sub

Public Function sEncode(What As String, WhatAlphabet As Integer) As String
Dim i As Integer
Dim pos As Integer
Dim TheAlphabet As String
Dim Alphabet(1 To 3) As String 'can be any number of dimentions you like
Alphabet(1) = "RrTtAaZzEeYyPpUuIiOoQqMwNmLlKkJjHhSsDdFfGgWnBbXxCcVv"
Alphabet(2) = "zERtAkJaZeYmLyPuIiOpUoQqMlKhSjHsDfGdFgWnBwNxCbXcVrTv"
Alphabet(3) = "cVyPTtZeRrzEYiAaOoQqLlKnuIBpUkJMmjHhSdFfGgWwNxCbXvsD"
a\$ = ""
For i = 1 To Len(What)
pos = InStr(TheAlphabet, Mid(What, i, 1))
a\$ = a\$ & Mid(Alphabet(WhatAlphabet), pos, 1)
Next
sEncode = a\$
End Function
0

IT OperationsCommented:
learning...
0

Commented:
You can use come encryption tool such as Rc2.dll

To use the Rc2.dll include the Dll in your references & then use the below code to encrypt

'' Encrypt
Dim obj_rc As New RC2Lib.RC2
dim str_Encrypted_Name  as string
str_Encrypted_Name = obj_rc.Encrypt "Customername"

'' Decrypt
Dim obj_rc As New RC2Lib.RC2
dim str_Decrypted_Name  as string
str_Decrypted_Name = obj_rc.Encrypt "Encrypted String"

0

Commented:
jayeshshah, you are not new to EE, so you should now better than to lock a question
to lock a question is EXTREMELY impolite
and more so since your 'answer' is not adding 'anything' to his topic, you did not even have the decency to tell dqb where to get this 'fantastic' dll
dqb, feel free to reject that 'answer'

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.