Changing a char to another char in a password

  • Thread starter Thread starter Dakkar
  • Start date Start date
D

Dakkar

I want to make a password system like this
every character will have an equal character
for example a will be equal to g and b will be equal to f
when person writes ab it will change automaticly to gf

is something like that possible if it is how?
 
Dakkar said:
I want to make a password system like this
every character will have an equal character
for example a will be equal to g and b will be equal to f
when person writes ab it will change automaticly to gf

is something like that possible if it is how?

It's very easy to change each character in a string, but I'm confused
as to how this is a password system - could you give more details,
please?
 
Define your needed Char Arrays

char[] plain = {'a' , 'b' , 'c'... };
char[] secret = {'g' , 'f' , 'i',.....};

protected void textBox_OnKeyPress(object sender , KeyPressEventArgs e)
{
int i=0;
foreach( char c in plain)
{
if(c == e.KeyChar)
{
char m = secret;
textBox.Text += m.ToString();
textBox.SelectionStart = textBox.Text.Length; //Put cursor
at the end
}
i++
}
}

That's your complete Solution

Hopes This Helps
 
When I was a kid, you could get a "decoder ring" that was a little plastic
toy ring. On the ring was a dial that turned around a center. On the dial
were the letters of the alphabet. In the center was another set of letters,
much more random. So, you can "encode" a message by finding the character
on the outside of the dial and writing down the letter on the inside of the
dial. You could use a different "setting" for each message or for each
person you communicate with.

It was cool!

For a toy.

This is called a "simple substitution cypher". Don't tell me you actually
intend to use this in a real computing project?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
Dakkar said:
I want to make a password system like this
every character will have an equal character
for example a will be equal to g and b will be equal to f
when person writes ab it will change automaticly to gf

is something like that possible if it is how?
 
Back
Top