PHP String Encryption Help

GarettM

Posting Freak
Aug 5, 2010
833
136
Ok So I Have Made 2 Encryption Functions.

This One Guarantees Safe Information But is it over doing it? :confused:
will this slow down the server load time?. :s
PHP:
function encrypt($key) {
        // Change Algorithm
        if(count($key) < 12) {
            $key = hash('sha256', $key);
        } else {
            $key = hash('gost', $key);
        }
        // Add Encrypted Key together
        $key = $key.md5($key).str_ireplace('1', 'efx', $key);
       
        // Return sha1 Encrypted .. Encrypted Key
        return sha1($key);
    }

Second
PHP:
function encrypt($key) {
        return hash('gost', sha1($key));
}

Are Both Secure and is this useless code? :confused:
 

Users who are viewing this thread

Top