Welcome Guest, Not a member yet? Register   Sign In
Security -- encrypt -- encode
#1

[eluser]Rodrigo Graça[/eluser]
I was wondering how encode function works? What algorithm they use?
For example here is the explanation of md5() : http://nsfsecurity.pr.erau.edu/crypto/md5.html

And its just me or when we encode something we can get different results? for example using this code:

Code:
$this->load->library("encrypt");
echo $this->encrypt->encode("Hello","key");

Every time that I press "F5" i get a different result why? its normal? so if i want try to find this result in some table it is impossible right?
#2

[eluser]WanWizard[/eluser]
md5() is a hashing algorithm. See http://en.wikipedia.org/wiki/Hash_function.

encode()/decode() are an encryption/decryption methods, unlike hashing you can decode the result of an encode if you have the correct key.

The Encrypt library uses the PHP mcrypt extension (http://php.net/manual/en/book.mcrypt.php) to encrypt (or falls back to an old-fashioned XOR algorithm if mcrypt is not loaded).
#3

[eluser]Rodrigo Graça[/eluser]
So, CI uses mcrypt to encode and decode the input?

I know how XOR works: https://en.wikipedia.org/wiki/File:XOR_ANSI.svg or https://en.wikipedia.org/wiki/File:XOR_from_NAND.svg

Bit how mcrypt works? Do you know any link? I want to see some kind of scheme about how it works, like i said here is how md5() and sha1() works:

md5: http://nsfsecurity.pr.erau.edu/crypto/sha1.html
sha1: http://nsfsecurity.pr.erau.edu/crypto/md5.html

And thanks!
#4

[eluser]WanWizard[/eluser]
Mcrypt is basically a library that provides a lot of different encryption methods, see http://www.php.net/manual/en/mcrypt.ciphers.php for the list of supported cyphers.

CI falls back to XOR if mcrypt is not loaded.




Theme © iAndrew 2016 - Forum software by © MyBB