0

Can I rely on the assumption that each generated id is random, and there's no way to user can guess? So that I don't need to do more double check of ownership and what not, on my application.

4

2 回答 2

1

通常,如果您将实例配置为使用random算法,您只会获得随机 uuid 。查看源代码时,您可以看到它使用了 Erlang 的crypto:rand_bytes/1。我不确定它的结果有多可预测,但您应该注意,还会有crypto:strong_rand_bytes/1 - 不确定为什么没有使用它。

我认为这个决定主要取决于其他情况。

  • 您要保护哪些信息?
  • 为什么要避免所有权检查作为额外的安全措施?
  • 你如何确保 _ids 不会以某种方式泄露(例如通过 CouchDB 的/_logAPI)?
于 2013-10-16T18:04:42.503 回答
0

我不会依赖那个,不。恶意用户可能会做出很多随机猜测,最终可能会击中某些东西。最好让标识符识别事物并且安全限制保护它们。

于 2013-10-16T15:26:26.550 回答