Here is the the format of encription
The password structure is as follows:
<section1>-<section2>-<section3>-<section4>-<section5>
The first name length added to the last name length.
i.e. 'David Lindley' = 5 + 7 = 12
The captialised last letter of the first name
i.e. 'David Lindley' = 'D'
The lowercasefirst character of the last name
i.e. 'David Lindley' = 'l'
The total number of vowels (a, e, i, o, u) in the full name
i.e. 'David Lindley' = 4
A hash of the name based on the following:
'David Lindley' = 'Davi Lney''Davi Lney' = 'DaviLney''DaviLney' = [100, 97, 118, 105, 108, 110, 101, 121]100 + 97 + 118 + 105 + 108 + 110 + 101 + 121 = 860
The output from step 4 is the code for Section 5'David Lindley' = '12-D-l-4-860'
The first number is there first name and last name added together
second letter is there first capital letter
third letter is there first lowercase letter
final number is following the space removal and duplicate letters, then adding the UTF-8/16 character code matching each letter
So my questions is how would i write a function that would take a encrypted string and then un-encrypt it to get there regular name
I'm not an expert in cryptography but I don't think you can since there is a loss of information. A reverse algorithm would have to compute an enormous amount of combinations using a dictionary of names, by encrypting them and checking them against your encrypted string. Basically brute forcing it.
You could then stop at the first match or maybe output a list of matches.
If you don't have to use this method and just need to encrypt/decrypt simple strings, I suggest you take to look at symmetric encryption