SSHA and friends

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Gerrad,

I use php in my self written usermanagement webapp.

Here a code snippet (part of a utility class) which works for me:

protected function generateSSHAHash($plaintext) {
        mt_srand((double)microtime()*1000000);
              
        $salt = $this->myhash_keygen_s2k(
                                    $plaintext,
                                    substr(pack('h*', md5(mt_rand())), 
0, 8),
                                    4 );
        $hash = "{SSHA}".base64_encode(hash('sha1', $plaintext.$salt, 
TRUE).$salt);

        return $hash;    
 }

protected function myhash_keygen_s2k($pass, $salt, $bytes ){
      return substr(pack("h*", sha1($salt . $pass)), 0, $bytes);
}

Cheers, Rudolf

Gerrard Geldenhuis wrote:
>
> Hi
>
> This is probably OT but I am not having much luck with google. How can 
> I create SSHA512 strings? I have been using either a php script or 
> slappasswd to create SSHA password but not sure how to do SSHA512. 
> openssl can create the SHA512 digest but I am not sure how to add the 
> random seed bit. My question probably illuminate my lack of 
> understanding of the subject.
>
>  
>
> Best Regards
>
>
> ________________________________________________________________________
> In order to protect our email recipients, Betfair Group use SkyScan from
> MessageLabs to scan all Incoming and Outgoing mail for viruses.
>
> ________________________________________________________________________
> ------------------------------------------------------------------------
>
> --
> 389 users mailing list
> 389-users at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/389-users


-- 
Rudolf Hatheyer
alpha nova Betriebsgesm.b.H.

Idlhofgasse 59-63
8020 Graz
Tel:   0043/316/722622
Fax:   0043/316/722622-16
Mobil: 0699/14032570

http://www.alphanova.at



[Index of Archives]     [Fedora User Discussion]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora News]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora QA]     [Fedora Triage]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Yosemite Photos]     [Linux Apps]     [Maemo Users]     [Gnome Users]     [KDE Users]     [Fedora Tools]     [Fedora Art]     [Fedora Docs]     [Maemo Users]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Fedora ARM]

  Powered by Linux