从激活密钥中删除特殊字符是否安全
在我的应用程序中,我创建了一个 64 个字符的激活密钥。 它具有特殊字符,例如
+ =
在构建 url 时我们正在进行 url 编码。但是,如果用户从他的电子邮件客户端复制 URL,则在某些客户端中,URL 会被解码。
一些建议是使用不需要 url 编码的章程删除这些特殊字符。 由于字符集受到限制,它会产生任何安全问题吗?
In my application I am creating a activation key of 64 characters.
It is having special characters like
+ =
While framing url we are doing url encode. But if user do a copy of the url from his email client , in some client url is getting url decoded.
Some suggestion is to remove these special character with charters which don't require url encode.
Will it going to create any issue in security as character set will be limited ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您仅使用字母数字字符,并且不区分大小写,则可能有 36 个字符。由于您的密钥有 64 个字符长,因此您最终会得到一个相当大的密钥空间(大于 GUID)。
根据您试图防止的情况(我假设暴力破解合法密钥),只要您生成它们的算法足够,您就不应该面临生成容易被猜到的密钥的风险。
If you use just alphanumeric characters, and make it case-insensitive, you will have 36 possible characters. Since your key is 64 characters long, you end up with a keyspace that is quite big (Larger than a GUID).
Depending what you are trying to protect this against (I assume brute forcing legitimate keys), so long as your algorithm for generating them is sufficient, you should not be at any risk of generating keys that are easily guessed.