Skip to content

keshunchen/php-sha1prng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

PHP-SHA1PRNG

You can use this php code to generate the 128bit AES KEY from the password

$key = substr(openssl_digest(openssl_digest($password, 'sha1', true), 'sha1', true), 0, 16);

like this java code.

        KeyGenerator _generator = KeyGenerator.getInstance("AES");
        SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
        secureRandom.setSeed(strPassword.getBytes());
        _generator.init(128, secureRandom);
        return _generator.generateKey();

Notes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages