|
|
| Author |
Message |
Sergey science forum beginner
Joined: 19 Jul 2006
Posts: 2
|
Posted: Wed Jul 19, 2006 7:10 pm Post subject:
Quadratic equavasion
|
|
|
I'm saving mutex into window registry for one of my programs, and I am
encrypting it using a simple quadratic equation. Such as y = x^2+20x, where
x is a value of a character (41 through 90), and y is a number I get which I
will store. Now, I was in college just about 4 or 3 years ago, or something
like that, work and all is turning me into moron. How do I solve for x? So
that I can decrypt this back into the character.
y=x^2+20x
x=? |
|
| Back to top |
|
 |
tadchem science forum Guru
Joined: 03 May 2005
Posts: 1348
|
Posted: Wed Jul 19, 2006 10:07 pm Post subject:
Re: Quadratic equavasion
|
|
|
Sergey wrote:
| Quote: | I'm saving mutex into window registry for one of my programs, and I am
encrypting it using a simple quadratic equation. Such as y = x^2+20x, where
x is a value of a character (41 through 90), and y is a number I get which I
will store. Now, I was in college just about 4 or 3 years ago, or something
like that, work and all is turning me into moron. How do I solve for x? So
that I can decrypt this back into the character.
y=x^2+20x
x=?
|
The quadratic formula:
If
0 = a*x^2 + b*x + c
then
x = [ - b +/- SQRT( b^2 - 4 * a * c)] / (2 * a)
(you get 2 answers for the price of one:
x = [ - b + SQRT( b^2 - 4 * a * c)] / (2 * a)
and
x = [ - b - SQRT( b^2 - 4 * a * c)] / (2 * a)
In your case, a = 1, b = 20, c = - y
HTH
Tom Davidson
Richmond, VA |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Nov 20, 2008 10:16 pm | All times are GMT
|
|
Loans | Loans | Credit Cards | Web Advertising | Loans
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
Other DeniX Solutions sites:
Electronics forum |
Medicine forum |
Unix/Linux blog |
Unix/Linux documentation |
Unix/Linux forums
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|