内容简介:http://stackoverflow.com/questions/5244455/best-practices-for-sessionid-authentication-token-generation
我看到有人使用UUID进行认证令牌生成.然而,在 RFC 4122
年,它表示
Do not assume that UUIDs are hard to guess; they should not be used as security capabilities (identifiers whose mere possession grants access), for example.
我想知道,在 Java 和.NET中为SessionId / AuthenticationToken生成使用了什么算法.在具有超过平均安全需求的应用程序中,UUID是否不适合这些目的?
UUID生成是随机的,但随机的熵意味着你最终会容易猜出UUID.如果您使用一个好的随机数生成器,可以生成可用于会话的UUID.但是,这样做的结果是,UUID没有内置的重播预防,篡改,固定等等,你必须自己处理这个问题(请看:UUID本身不应被视为一个有效的会话ID本身).也就是说,这是一个很好的代码片段,您将如何使用 python 生成安全的UUID:
http://stackoverflow.com/questions/5244455/best-practices-for-sessionid-authentication-token-generation
以上所述就是小编给大家介绍的《SessionId /认证令牌生成的最佳做法》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Refactoring
Martin Fowler、Kent Beck、John Brant、William Opdyke、Don Roberts / Addison-Wesley Professional / 1999-7-8 / USD 64.99
Refactoring is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its int......一起来看看 《Refactoring》 这本书的介绍吧!
JS 压缩/解压工具
在线压缩/解压 JS 代码
URL 编码/解码
URL 编码/解码