<small id='F0qOE'></small><noframes id='F0qOE'>

        <bdo id='F0qOE'></bdo><ul id='F0qOE'></ul>
      <legend id='F0qOE'><style id='F0qOE'><dir id='F0qOE'><q id='F0qOE'></q></dir></style></legend>

      1. <tfoot id='F0qOE'></tfoot>
      2. <i id='F0qOE'><tr id='F0qOE'><dt id='F0qOE'><q id='F0qOE'><span id='F0qOE'><b id='F0qOE'><form id='F0qOE'><ins id='F0qOE'></ins><ul id='F0qOE'></ul><sub id='F0qOE'></sub></form><legend id='F0qOE'></legend><bdo id='F0qOE'><pre id='F0qOE'><center id='F0qOE'></center></pre></bdo></b><th id='F0qOE'></th></span></q></dt></tr></i><div id='F0qOE'><tfoot id='F0qOE'></tfoot><dl id='F0qOE'><fieldset id='F0qOE'></fieldset></dl></div>

        以编程方式构建 htpasswd

        Programmatically building htpasswd(以编程方式构建 htpasswd)
          <bdo id='D47RL'></bdo><ul id='D47RL'></ul>
        • <tfoot id='D47RL'></tfoot>
        • <small id='D47RL'></small><noframes id='D47RL'>

                  <legend id='D47RL'><style id='D47RL'><dir id='D47RL'><q id='D47RL'></q></dir></style></legend>
                  <i id='D47RL'><tr id='D47RL'><dt id='D47RL'><q id='D47RL'><span id='D47RL'><b id='D47RL'><form id='D47RL'><ins id='D47RL'></ins><ul id='D47RL'></ul><sub id='D47RL'></sub></form><legend id='D47RL'></legend><bdo id='D47RL'><pre id='D47RL'><center id='D47RL'></center></pre></bdo></b><th id='D47RL'></th></span></q></dt></tr></i><div id='D47RL'><tfoot id='D47RL'></tfoot><dl id='D47RL'><fieldset id='D47RL'></fieldset></dl></div>
                    <tbody id='D47RL'></tbody>
                  本文介绍了以编程方式构建 htpasswd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否有一种编程方式来构建 htpasswd 文件,而不依赖于操作系统特定的函数(即 exec()passthru())?

                  Is there a programmatic way to build htpasswd files, without depending on OS specific functions (i.e. exec(), passthru())?

                  推荐答案

                  .httpasswd 文件只是具有特定格式的文本文件,具体取决于指定的散列函数.如果您使用的是 MD5,它们看起来像这样:

                  .httpasswd files are just text files with a specific format depending on the hash function specified. If you are using MD5 they look like this:

                  foo:$apr1$y1cXxW5l$3vapv2yyCXaYz8zGoXj241
                  

                  那是登录名、冒号、,$apr1$、盐和 1000 次 md5 编码为 base64.如果您选择 SHA1,它们看起来像这样:

                  That's the login, a colon, ,$apr1$, the salt and 1000 times md5 encoded as base64. If you select SHA1 they look like this:

                  foo:{SHA}BW6v589SIg3i3zaEW47RcMZ+I+M=
                  

                  这是登录名、冒号、字符串 {SHA} 和用 base64 编码的 SHA1 哈希.

                  That's the login, a colon, the string {SHA} and the SHA1 hash encoded with base64.

                  如果您的语言实现了 MD5 或 SHA1 和 base64,您可以像这样创建文件:

                  If your language has an implementation of either MD5 or SHA1 and base64 you can just create the file like this:

                  <?php
                  
                  $login = 'foo';
                  $pass = 'pass';
                  $hash = base64_encode(sha1($pass, true));
                  
                  $contents = $login . ':{SHA}' . $hash;
                  
                  file_put_contents('.htpasswd', $contents);
                  
                  ?>
                  

                  以下是有关格式的更多信息:

                  Here's more information on the format:

                  http://httpd.apache.org/docs/2.2/misc/password_encryptions.html

                  这篇关于以编程方式构建 htpasswd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Zend_Controller_Router_Exception: quot;xyzquot; is not specified(Zend_Controller_Router_Exception:“xyz;未指定)
                  Zend_Db_Table subquery(Zend_Db_Table 子查询)
                  pcntl_fork and the MySQL connection is gone(pcntl_fork 和 MySQL 连接消失了)
                  Change layout in the controller of Zend Framework 2.0(在 Zend Framework 2.0 的控制器中更改布局)
                  Zend Mail Gmail SMTP(Zend 邮件 Gmail SMTP)
                  Zend_Form: how to check 2 fields are identical(Zend_Form:如何检查 2 个字段是否相同)
                    <i id='gwDvz'><tr id='gwDvz'><dt id='gwDvz'><q id='gwDvz'><span id='gwDvz'><b id='gwDvz'><form id='gwDvz'><ins id='gwDvz'></ins><ul id='gwDvz'></ul><sub id='gwDvz'></sub></form><legend id='gwDvz'></legend><bdo id='gwDvz'><pre id='gwDvz'><center id='gwDvz'></center></pre></bdo></b><th id='gwDvz'></th></span></q></dt></tr></i><div id='gwDvz'><tfoot id='gwDvz'></tfoot><dl id='gwDvz'><fieldset id='gwDvz'></fieldset></dl></div>
                    • <bdo id='gwDvz'></bdo><ul id='gwDvz'></ul>

                      <legend id='gwDvz'><style id='gwDvz'><dir id='gwDvz'><q id='gwDvz'></q></dir></style></legend>

                        <tfoot id='gwDvz'></tfoot>
                      1. <small id='gwDvz'></small><noframes id='gwDvz'>

                              <tbody id='gwDvz'></tbody>