当前位置:网站首页>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替换掉就可以了。
边栏推荐
- Implementation of macro instruction of first-order RC low-pass filter in signal processing (easy touch screen)
- openresty 重定向
- PXE网络
- Summer Review, we must avoid stepping on these holes!
- 都在说DevOps,你真正了解它吗?
- flutter 报错 No MediaQuery widget ancestor found.
- 每周招聘|高级DBA年薪49+,机会越多,成功越近!
- Deep learning 7 transformer series instance segmentation mask2former
- Guitar Pro 8win10 latest guitar learning / score / creation
- Introduction of text mining tools [easy to understand]
猜你喜欢

Ranking list of databases in July: mongodb and Oracle scores fell the most

.Net 应用考虑x64生成

Five minutes per day machine learning: use gradient descent to complete the fitting of multi feature linear regression model

go-zero微服务实战系列(九、极致优化秒杀性能)

每周招聘|高级DBA年薪49+,机会越多,成功越近!

产品好不好,谁说了算?Sonar提出分析的性能指标,帮助您轻松判断产品性能及表现

When synchronized encounters this thing, there is a big hole, pay attention!

内存管理总结

Ali was laid off employees, looking for a job n day, headhunters came bad news

Why do domestic mobile phone users choose iPhone when changing a mobile phone?
随机推荐
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
Five minutes of machine learning every day: why do we need to normalize the characteristics of numerical types?
Preliminary exploration of flask: WSGI
重排数组
selenium 浏览器(2)
Hexadecimal form
Luo Gu - some interesting questions
The performance of major mainstream programming languages is PK, and the results are unexpected
Redis publier et s'abonner
每周招聘|高级DBA年薪49+,机会越多,成功越近!
03 storage system
unity update 协程_Unity 协程的原理
十六进制
Ali was laid off employees, looking for a job n day, headhunters came bad news
Introduction of text mining tools [easy to understand]
深度学习 神经网络案例(手写数字识别)
Redis 發布和訂閱
Kubernets pod exists finalizers are always in terminating state
IO流:节点流和处理流详细归纳。
Leetcode 1200 minimum absolute difference [sort] The Path of leetcode for heroding