Pwdgen-Password generation tool implemented with the Go language

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

For the CSDN and other major sites to save passwords for the problem,
Wrote a password generation tool Pwdgen (support for generating keepass format) in the Go language.

Here is the code that generates the algorithm and implementation:

// base58(sha512(md5hex(encrypt_key+encrypt_salt)+site_id+site_salt)[0:16]func pwdgen(site_id, site_salt, encrypt_key, encrypt_salt string) string {    md5 := md5.New()    md5.Write([]byte(encrypt_key + encrypt_salt))    md5Hex := fmt.Sprintf("%x", md5.Sum(nil))    sha := sha512.New()    sha.Write([]byte(md5Hex + site_id + site_salt))    shaSum := sha.Sum(nil)    pwd := base58.EncodeBase58(shaSum)[0:16]    return string(pwd)}

For a complete program, visit: Https://bitbucket.org/chai2010/pwdgen/wiki/Home

For online documentation, please visit:

  • Http://godoc.org/bitbucket.org/chai2010/pwdgen
  • Http://godoc.org/bitbucket.org/chai2010/pwdgen/base58
  • Http://godoc.org/bitbucket.org/chai2010/pwdgen/ini
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.