<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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <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>