当前位置:网站首页>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替换掉就可以了。
边栏推荐
- Optimization method of deep learning neural network
- Leetcode 1200 minimum absolute difference [sort] The Path of leetcode for heroding
- Guitar Pro 8win10 latest guitar learning / score / creation
- 现代控制理论入门+理解
- Decimal, exponential
- UFO: Microsoft scholars have proposed a unified transformer for visual language representation learning to achieve SOTA performance on multiple multimodal tasks
- Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
- Implementation of macro instruction of first-order RC low-pass filter in signal processing (easy touch screen)
- Flutter reports an error no mediaquery widget ancestor found
- openresty 重定向
猜你喜欢
如何配和弦
Redis的4种缓存模式分享
How did the beyond concert 31 years ago get super clean and repaired?
深度学习 神经网络的优化方法
Preliminary exploration of flask: WSGI
Redis哨兵模式实现一主二从三哨兵
Expose Ali's salary and position level
[local differential privacy and random response code implementation] differential privacy code implementation series (13)
近一亿美元失窃,Horizon跨链桥被攻击事件分析
Guitar Pro 8win10最新版吉他学习 / 打谱 / 创作
随机推荐
Kubernets Pod 存在 Finalizers 一直处于 Terminating 状态
一篇文章学会GO语言中的变量
ES6 modularization
Introduction to asynchronous task capability of function calculation - task trigger de duplication
Implementation of web chat room
openresty 重定向
CentOS 6.3 下 PHP编译安装JSON模块报错解决
深度学习 神经网络的优化方法
Deep learning 7 transformer series instance segmentation mask2former
Halo effect - who says that those with light on their heads are heroes
左右对齐!
金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~
Redis publier et s'abonner
hexadecimal
EventBridge 在 SaaS 企业集成领域的探索与实践
I plan to teach myself some programming and want to work as a part-time programmer. I want to ask which programmer has a simple part-time platform list and doesn't investigate the degree of the receiv
【学习笔记】拟阵
03 storage system
输入宽度!
重排数组