Solved

password

Posted on 2002-07-26
6
193 Views
Last Modified: 2010-05-02
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
Comment
Question by:dgb
6 Comments
 
LVL 4

Expert Comment

by:P1
ID: 7181134
Create an algorithm to convert customer name into a big number.  Convert the number base to 52, decode as 0=A, 51=z.

Enjoy your work,  P1
0
 
LVL 20

Expert Comment

by:hes
ID: 7181172
0
 
LVL 6

Accepted Solution

by:
pierrecampe earned 100 total points
ID: 7181586
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
    TheAlphabet = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
    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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7181604
learning...
0
 
LVL 5

Expert Comment

by:jayeshshah
ID: 7181704
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
 
LVL 6

Expert Comment

by:pierrecampe
ID: 7182804
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
you would do better to read the Comment vs Answers at the bottom of this page
dqb, feel free to reject that 'answer'

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question