在pg_shadow中加密密码加盐 [英] Salt in encrypted password in pg_shadow

查看:160
本文介绍了在pg_shadow中加密密码加盐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读到pg_shadow中的密码哈希是用用户名加密的。

这仍然是这样吗?如果是这样,因为可能99%的PostgreSQL都有

" postgres"作为超级用户名,使用标准的

Unix / Apache MD5哈希不是更好吗?


-

dave

---------------------------(播出结束)------- --------------------

提示2:您可以使用取消注册命令一次性取消所有列表

(发送取消注册YourEmailAddressHere到 ma*******@postgresql.org

解决方案

David Garamond< li *** @ zara.6.isreserved.com>写道:

我读到pg_shadow中的密码哈希是用用户名加密的。
这仍然是这样吗?如果是这样,因为大约99%的PostgreSQL都有postgres。作为超级用户名,使用标准的Unix / Apache MD5哈希不是更好吗?




如何改进?如果我们在其中添加一个随机盐,我们将要求b
必须将盐存储在pg_shadow中,所以不会有任何保密

加上---一个可以阅读pg_shadow的攻击者也可以看到盐。


(实际上,能够读取pg_shadow的攻击者已经是超级用户,

所以它是'不清楚还有什么可以躲避他的。)


问候,汤姆小巷


------- --------------------(广播结束)------------------------- -

提示5:您是否检查过我们广泛的常见问题解答?

http://www.postgresql.org/docs/faqs/FAQ.html


< blockquote> Tom Lane写道:

我读到pg_shadow中的密码哈希是用用户名加密的。
这仍然是这样吗?如果是这样,因为大约99%的PostgreSQL都有postgres。作为超级用户名,使用标准的Unix / Apache MD5哈希不是更好吗?
如何改进任何东西?如果我们在其中添加一个随机盐,我们就必须将盐存储在pg_shadow中,这样就不会增加任何保密性 - 一个可以阅读pg_shadow的攻击者可以看到盐也是。




考虑一下创建一个长列表的人:


MD5(postgres+" aaaaaaaa)

MD5(postgres+aaaaaaab)

MD5(postgres+aaaaaaac)

...


现在,如果他可以访问其他人的pg_shadow,他可以将

哈希与他的字典进行比较。替换postgres随机盐

击败这个字典攻击(因此他将不得不求助于粗暴的

力量)。

(实际上,攻击者谁能读懂pg_shadow已经是超级用户了,所以不清楚还有什么东西可以躲避他。)




但是考虑一下找到包含数据库的硬盘或磁带的人

备份......然后他可以访问真实的在线数据库。


-

dave

---------------------------(播出结束)--- ------------------------

提示3:如果通过Usenet发布/阅读,请发送相应的

subscribe-nomail命令 ma*******@postgresql.org 以便

消息可以干净地通过邮件列表


David Garamond写道:

考虑一下谁创建了一个很长的列表:
MD5(postgres) +aaaaaaaa )MD5(postgres+aaaaaaab)
MD5(postgres+aaaaaaac)


现在如果他可以访问其他人的pg_shadow,他可以将
哈希与他的字典进行比较。替换postgres用一个随意的盐
击败这个字典攻击(因此他将不得不求助于粗暴的力量)。




但你肯定必须将随机盐存储在pg_shadow中?或者我是否b $ b缺少一些东西?


-

Richard Huxton

Archonet Ltd


---------------------------(广播结束)-------- -------------------

提示6:您是否搜索了我们的列表档案?

http://archives.postgresql.org


I read that the password hash in pg_shadow is salted with username. Is
this still the case? If so, since probably 99% of all PostgreSQL has
"postgres" as the superuser name, wouldn''t it be better to use standard
Unix/Apache MD5 hash instead?

--
dave
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

解决方案

David Garamond <li***@zara.6.isreserved.com> writes:

I read that the password hash in pg_shadow is salted with username. Is
this still the case? If so, since probably 99% of all PostgreSQL has
"postgres" as the superuser name, wouldn''t it be better to use standard
Unix/Apache MD5 hash instead?



How does that improve anything? If we add a random salt into it, we''d
have to store the salt in pg_shadow, so there wouldn''t be any secrecy
added --- an attacker who can read pg_shadow could see the salt too.

(Actually, an attacker who can read pg_shadow is already superuser,
so it''s not clear there''s anything left to hide from him anyway.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Tom Lane wrote:

I read that the password hash in pg_shadow is salted with username. Is
this still the case? If so, since probably 99% of all PostgreSQL has
"postgres" as the superuser name, wouldn''t it be better to use standard
Unix/Apache MD5 hash instead?
How does that improve anything? If we add a random salt into it, we''d
have to store the salt in pg_shadow, so there wouldn''t be any secrecy
added --- an attacker who can read pg_shadow could see the salt too.



Consider someone who creates a long list of:

MD5( "postgres" + "aaaaaaaa" )
MD5( "postgres" + "aaaaaaab" )
MD5( "postgres" + "aaaaaaac" )
...

Now if he has access to other people''s pg_shadow, he can compare the
hashes with his dictionary. Replacing "postgres" with a random salt
defeats this dictionary attack (and thus he will have to resort to brute
force).
(Actually, an attacker who can read pg_shadow is already superuser,
so it''s not clear there''s anything left to hide from him anyway.)



But consider someone who finds a harddisk or tape containing a database
backup... he can then gain access to the real, online database.

--
dave
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly


David Garamond wrote:

Consider someone who creates a long list of:

MD5( "postgres" + "aaaaaaaa" )
MD5( "postgres" + "aaaaaaab" )
MD5( "postgres" + "aaaaaaac" )
...

Now if he has access to other people''s pg_shadow, he can compare the
hashes with his dictionary. Replacing "postgres" with a random salt
defeats this dictionary attack (and thus he will have to resort to brute
force).



But surely you have to store the random salt in pg_shadow too? Or am I
missing something?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


这篇关于在pg_shadow中加密密码加盐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆