|
lastFarhi wrote: password will be taken from textbox and will be stored in SQL Server DB. i want to do encryption while storing password in DB and algorithm is required here
Generally, storing a password is bad.
Most people hash the password and store that in the database.
When the user logs in you take the password they give, hash it, and compare this hash to what is stored in the database.
Encrypting the password means you can decrypt it (recover it), encryption is 2-way.
Hashing the password is 1-way, you can't recover the password from the hash.
The SHA family are the most common (current) algorithms.
http://en.wikipedia.org/wiki/SHA-1[^]
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Have you tried looking at the Crytopgraphy Application Block within Enterprise Library. Why not download Entperise Library from MSDN and give it a go. Personally, I find the Crytopgraphy Application Block within Enterprise Library to contain more useful routines than what is available within in the .net framework.
|
|
|
|
|
has anyone marshalled the Intel math kernal library to managed code (aka C#)? An example would be excellent. Thx
|
|
|
|
|
These guys have made a wrapper around the MKL:
http://www.dnanalytics.net/doku.php
Might help?
|
|
|
|
|
Hey, I didn't know about this. Looks a bit new and incomplete but certainly interesting to get going with, and perhaps to contribute to.
Thanks.
|
|
|
|
|
|
Hi all,
I haven't had much luck but I was wondering if you would know a good way to take a value assgine it to x then draw a line with a random slope through that point and take two random points off that line.
Ideas
sudo code
code in your favorite lang
alllll welcome
i really need the help.
Thanks
|
|
|
|
|
Hi,
you want 3 points, and you have 5 degrees of freedom, since the only restriction is
the points must be colinear. So we call a "random" function 5 times:
a random point:
pt1=new Point(random(xmin, xmax), random(ymin, ymax));
a second point in random direction, random distance (hence completely random):
pt2=new Point(random(xmin, xmax), random(ymin, ymax));
a third point on the same line:
dist=random();
pt3=new Point(pt1.x+dist*(pt2.x-pt1.x), pt1.y+dist*(pt2.y-pt1.y));
BTW you may want to limit the range of dist so pt3 also falls within the borders.
-- modified at 6:59 Monday 14th May, 2007
|
|
|
|
|
Luc Pattyn wrote: you want 3 points, and you have 5 degrees of freedom, since the only restriction is
the points must be colinear
In our 2-dimensional world, of course!!!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Sure, but most drawings use only 2 dimensions.
If more are required, it becomes 3*D-1 degrees of freedom for D dimensions,
unless you want to go fractal.
|
|
|
|
|
Luc Pattyn wrote: but most drawings use only 2 dimensions.
as long as what you are drawing has 2 Dimensions.
Even when I draw 2D it is usually map projected over 3D so I still end up in 3D eventually.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
El Corazon wrote: as long as what you are drawing has 2 Dimensions.
I don't think he was talking about the display device dimensions.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
wow!
ask a good forum get a good answer
thanks guys ill try this out later to day
Just in case any one is curious.
I'm taking a string password and converting it to a number value
that value = x
then you draw the line so it passes through x with a line with a random slope then you collect any two points off that line
then you give a point set to person 1
and give point set to person 2
they can not figure out what the password was unless they both meet and have figure plot out the line they make together
technically you could give you more than 2 points but any two of them can combine to give you the password
also if you wanted to do something with lets say a parabola (spell check) then it would take at least 3 people to figure out where the parabola touches X
thanks for all your help I hope it works
|
|
|
|
|
you dont need geometry for this, give both persons half of your password !
|
|
|
|
|
no
if i give you
"pass"
you could probably figure it out
also you would be reducing a 8 char password to basically 4 char for a brute force.
this way neither has anything that they can use. unless certain requirements are meet.
you could also do something like lock up one set in a safety depoest box and give your lawyer or your friend
when you die they would have access to your password if they were doing something with your estate.
we were thinking of using this at work so that one group could not do maintaince on a server with out some one from another group present with the other half of lets say roots password.
you wouldn't want anyone walking around with root password unless they needed to know it.
|
|
|
|
|
one more thing
in the event of a system failure or something like this
this type of password "encryption" you could decrypt with a calculator or a pencil
you don't nesscarly have to have a fancy program to undo it ( or do it for that matter)
|
|
|
|
|
private void button2_Click(object sender, EventArgs e)
{
Random random = new Random();
//random.Next(min, max);
int xmin, xmax, ymin,ymax;
xmin = Convert.ToInt16( textBox1.Text);
xmax = Convert.ToInt16(textBox2.Text);
ymin = Convert.ToInt16(textBox1.Text);
ymax = Convert.ToInt16(textBox2.Text);
//a random point:
Point pt1 = new Point(random.Next(xmin, xmax), random.Next(ymin, ymax));
//a second point in random direction, random distance (hence completely random):
Point pt2 = new Point(random.Next(xmin, xmax), random.Next(ymin, ymax));
//a third point on the same line:
int dist = random.Next(xmin, xmax);
Point pt3 = new Point((pt1.X + dist) * (pt2.X - pt1.X), (pt1.Y + dist) * (pt2.Y - pt1.Y));
textBox3.Text = pt3.X.ToString();
textBox4.Text = pt3.Y.ToString();
textBox5.Text = pt1.X.ToString();
textBox6.Text = pt1.Y.ToString();
textBox7.Text = pt2.X.ToString();
textBox8.Text = pt2.Y.ToString();
}
I got to at least compile in c# but as I'm watching it i still think its backwards
how can I define X first.
|
|
|
|
|
crash893 wrote: Point pt3 = new Point((pt1.X + dist) * (pt2.X - pt1.X), (pt1.Y + dist) * (pt2.Y - pt1.Y));
is incorrect.
|
|
|
|
|
would you mind telling me why its incorrect
or at least where its wrong
thanks
|
|
|
|
|
because it differs from what I gave you before
because you now are multiplying coordinates
because the way it was set up, you should get pt1 when dist=0 and pt2 when dist=1
...
|
|
|
|
|
a random point:
pt1=new Point(random(xmin, xmax), random(ymin, ymax));
a second point in random direction, random distance (hence completely random):
pt2=new Point(random(xmin, xmax), random(ymin, ymax));
a third point on the same line:
dist=random();
pt3=new Point(pt1.x+dist*(pt2.x-pt1.x), pt1.y+dist*(pt2.y-pt1.y));
----------------------------------------------
I made a few changes so it would compile in c#
On random i was getting:
random' is a 'variable' but is used like a 'method'
so i changed it to:
random.Next(xmin, xmax)
Then i had to define xmin and xmax as int
(i'm still a little unclear on how to use this)
then i changed
(pt1.x+dist*(pt2.x-pt1.x) to ((pt1.x+dist)*(pt2.x-pt1.x)
going back i have no idea why i did this but i changed it back and it works now
I don't want you to think i don't appreciate your help i just am a little lost on how this is working.
|
|
|
|
|
Hi,
my original post was pseudo-code (this is the math forum).
I assumed you would use real numbers for everything.
using ints for coordinates is OK, but the dist parameter must be a float,
so I suggest you do something like
float dist=random.Next(0,1000)/1000.0;
which gets a real number between 0.0 and 1.0
|
|
|
|
|
here is where im still not getting it
what variable would i use to input my secret code
say i want to put in 1234 how do i do that?
the way i saw it working is
password in -> Luc Pattyn's algo -> output = 2sets of xy corrndates
im probably missing something very obvous
|
|
|
|
|
I answered your original question about three points on a line;
I dont see how a password gets translated in one or more points;
and I dont believe your password story makes any sense
|
|
|
|
|
It makes sense it just might be my ability to explain it.
1) take a value (12)
2) take a some graph paper and on the draw a dot on 12x
3) draw a line of any slope you want
4) then pick any two points along the line you just drew vola
thats what im trying to do.
And again this could jsut go back to me not understanding something right infront of me but it appears to do these steps in some what reverse order
you make two points then run find what value that runs through which doesnt work becuase the value of x is what is important
I have been reading through the old post in this tread and it shouldnt be 3 points of freedom it should be 2 or mabey 1
if i know that one point is X=varable,y=0 (call it pnt0
couldnt i make a random point then draw a line
from that random point to Pnt0
then expand the line a little and get a diffrent value?
just thought of that but im not sure how to write it up.
thanks
|
|
|
|