duanjiuhong5843 2017-01-13 14:08
浏览 339
已采纳

使用php和doveadm创建密码

I've created an registration page in php with an mysql backend. If the user is entering his new password it should become SHA512-CRYPT via doveadm.

This is what I have now,

$password=hash('sha256', $pass);

But I want to create a password hash with doveadm because of my mail server:

$password=(/usr/bin/doveadm pw -s SHA512-CRYPT -p "$pass")

But it doesn't seem to work, how can i implement this "doveadm" command in php?

  • 写回答

2条回答 默认 最新

  • douhuilin1152 2017-01-13 15:52
    关注

    You must call it with shell_exec method:

    $password = shell_exec('/usr/bin/doveadm pw -s SHA512-CRYPT -p '. $pass);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用