当前位置:网站首页>odoo数据库主控密码采用什么加密算法?
odoo数据库主控密码采用什么加密算法?
2022-07-04 14:13:00 【weixin_43425561】
默认采用的加密算法是pbkdf2_sha512,通过哈希算法加盐迭代数次得出的结果作为密码的算法。它的基本原理是通过一个伪随机函数(例如HMAC函数),把明文和一个盐值作为输入参数,然后重复进行运算,并最终产生密钥。如果重复的次数足够大,破解的成本就会变得很高。而盐值的添加也会增加“彩虹表”攻击的难度。
我们看一个经过这种加密算法得出的密码结构:
$pbkdf2-sha512 25000 25000 25000ztkbw5jT.l8LwThHKKX03g$EFv2mH5uUh6VEZi4mmvzphsDnQdI1ufTw6JxppxXPfRIUj5JBK9N/kd.5NgiCCylwgiyUqCk0CiugHdYQQXNKA
密码通过$符号被分隔成4部分,第一个部分是计算算法名称,第二个是迭代次数,第三部分是盐值,第四部分是hash值。
激活odoo虚拟环境,在命令行运行python,通过以下语句可将明文密码’admin’进行加密,你也可以将’admin’换成你想使用的任何明文密码。
from passlib.context import CryptContext
print(CryptContext(['pbkdf2_sha512','plaintext'],deprecated=['plaintext'],).encrypt('admin'))
可得:
$pbkdf2-sha512$25000$ztkbw5jT.l8LwThHKKX03g$EFv2mH5uUh6VEZi4mmvzphsDnQdI1ufTw6JxppxXPfRIUj5JBK9N/kd.5NgiCCylwgiyUqCk0CiugHdYQQXNKA
放到odoo.conf中,
admin_passwd=$pbkdf2-sha512$25000$ztkbw5jT.l8LwThHKKX03g$EFv2mH5uUh6VEZi4mmvzphsDnQdI1ufTw6JxppxXPfRIUj5JBK9N/kd.5NgiCCylwgiyUqCk0CiugHdYQQXNKA
哪天忘记了数据库主控密码,你可以使用上述方法生成一个新的加密密码,将odoo.conf中的admin_passwd替换掉就可以了。
边栏推荐
- 03 storage system
- 开源人张亮的 17 年成长路线,热爱才能坚持
- C1 certification learning notes 3 -- Web Foundation
- 近一亿美元失窃,Horizon跨链桥被攻击事件分析
- 力扣刷题01(反转链表+滑动窗口+LRU缓存机制)
- Preliminary exploration of flask: WSGI
- 5g TV cannot become a competitive advantage, and video resources become the last weapon of China's Radio and television
- Analysis of nearly 100 million dollars stolen and horizon cross chain bridge attacked
- Expose Ali's salary and position level
- 自动控制原理快速入门+理解
猜你喜欢
Preliminary exploration of flask: WSGI
Ranking list of databases in July: mongodb and Oracle scores fell the most
都在说DevOps,你真正了解它吗?
Kubernets Pod 存在 Finalizers 一直处于 Terminating 状态
MP3是如何诞生的?
这几年爆火的智能物联网(AIoT),到底前景如何?
Guitar Pro 8win10 latest guitar learning / score / creation
Halcon knowledge: NCC_ Model template matching
Flutter reports an error no mediaquery widget ancestor found
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
随机推荐
深度学习 神经网络案例(手写数字识别)
Deep learning neural network case (handwritten digit recognition)
EventBridge 在 SaaS 企业集成领域的探索与实践
PXE网络
Redis 发布和订阅
On the implementation plan of MySQL explain
Techsmith Camtasia Studio 2022.0.2屏幕录制软件
Weibo and Huya advance into interest communities: different paths for peers
LeetCode 1200 最小绝对差[排序] HERODING的LeetCode之路
Decimal, exponential
Deep learning 7 transformer series instance segmentation mask2former
金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~
Redis publish and subscribe
IO flow: node flow and processing flow are summarized in detail.
What are the concepts of union, intersection, difference and complement?
hexadecimal
5g TV cannot become a competitive advantage, and video resources become the last weapon of China's Radio and television
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
Openresty current limiting
【大连理工大学】考研初试复试资料分享