Hi there
This is the first time I have posted here and not sure if this is the best forum for this question but I'll try this room anyway so here it goes.
I am trying to write a public key encryption system based on the RSA Algorithm and have read lots of resources on the matter. I have however not an expert at PHP and so finding it hard to translate some of what I have read into php code.
What I am looking for is either a link or reply to this that can tell me how I can create the 3 values needed
n, e and d
where I need to create large prime numbers.
If anyone has information on creating large prime numbers and/or checking a value is a prime number whcih after reading information on the maths for this still has me confused that would be a great help or if anyone has the code or a link to source code for the RSA Algorithm I would very much appreciate it.
NOTE - I do not want to use extra moduals for this
Thanks
Fly
PS: why do I want this ?
I intend on combing this with javascript to let users send secure information when SSL is not avaliable.
Encryption/Decryption
Moderator: General Moderators
Have you checked out PHP's own encryption and decryption-function? I am no expert by far, but the existing PHP-functions more, much more than cover my needs.
Have a look at:
http://www.php.net/manual/en/function.md5.php
http://www.php.net/manual-lookup.php?pa ... on&lang=en
Have a look at:
http://www.php.net/manual/en/function.md5.php
http://www.php.net/manual-lookup.php?pa ... on&lang=en
Are you sure you want to do it in PHP? For public key encryption it is very common to use GnuPG, which exists on virtually all *nix machines, and is easy to install on a win machine, http://www.gnupg.org , access from php with a shell call
you might find http://primes.utm.edu usefull, esp. http://primes.utm.edu/notes/prp_prob.html and http://primes.utm.edu/prove/prove2_3.html
..i am no mathematic nor cryptolic expert, but i am pretty sure that using PHP native math functions to create a fully functional RSA or simiar algorithm, it will be very slow and inefficient.. howver, using modules that are ment for such and/or your own compiled (C etc) programs or freely available ones it will execute a lot faster.. It is truly amazing how good and fast gnupg and openssl is at doing such..