gpt4 book ai didi

security - MongoDB 使用什么散列函数来散列数据库用户密码?

转载 作者:IT老高 更新时间:2023-10-28 13:27:44 28 4
gpt4 key购买 nike

在 MongoDb 中使用可以将用户添加到数据库以进行访问控制。可以插入用户:

db.addUser({ user: "aaaa", pwd: "1234", roles: [...]})

插入的用户是:

{
"user" : "aaa",
"pwd" : "08ccdf34dbb3ca05dcc195e30994b628",
"roles" : [
"userAdminAnyDatabase"
],
"_id" : ObjectId("52a88b45965c4e7ad46bb97b")
}

MongoDB 使用什么函数来计算/散列 pwd 键?

最佳答案

The pwd is the hex encoding of MD5( username + ":mongo:" + password_text ).

来自官方documentation .

结果与您在 json 中显示的哈希值不一致,但我认为您在添加 "aaaa" 时替换了实际的用户名和密码,但检索 "aaa"

关于security - MongoDB 使用什么散列函数来散列数据库用户密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20523891/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com