久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <bdo id='uSWNf'></bdo><ul id='uSWNf'></ul>
    <i id='uSWNf'><tr id='uSWNf'><dt id='uSWNf'><q id='uSWNf'><span id='uSWNf'><b id='uSWNf'><form id='uSWNf'><ins id='uSWNf'></ins><ul id='uSWNf'></ul><sub id='uSWNf'></sub></form><legend id='uSWNf'></legend><bdo id='uSWNf'><pre id='uSWNf'><center id='uSWNf'></center></pre></bdo></b><th id='uSWNf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uSWNf'><tfoot id='uSWNf'></tfoot><dl id='uSWNf'><fieldset id='uSWNf'></fieldset></dl></div>
    <legend id='uSWNf'><style id='uSWNf'><dir id='uSWNf'><q id='uSWNf'></q></dir></style></legend>
  1. <small id='uSWNf'></small><noframes id='uSWNf'>

    1. <tfoot id='uSWNf'></tfoot>

      GUID 的安全性如何?

      How securely unguessable are GUIDs?(GUID 的安全性如何?)

        <tbody id='ZXCZq'></tbody>

        <bdo id='ZXCZq'></bdo><ul id='ZXCZq'></ul>
        <tfoot id='ZXCZq'></tfoot>
      • <small id='ZXCZq'></small><noframes id='ZXCZq'>

        <i id='ZXCZq'><tr id='ZXCZq'><dt id='ZXCZq'><q id='ZXCZq'><span id='ZXCZq'><b id='ZXCZq'><form id='ZXCZq'><ins id='ZXCZq'></ins><ul id='ZXCZq'></ul><sub id='ZXCZq'></sub></form><legend id='ZXCZq'></legend><bdo id='ZXCZq'><pre id='ZXCZq'><center id='ZXCZq'></center></pre></bdo></b><th id='ZXCZq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZXCZq'><tfoot id='ZXCZq'></tfoot><dl id='ZXCZq'><fieldset id='ZXCZq'></fieldset></dl></div>

              1. <legend id='ZXCZq'><style id='ZXCZq'><dir id='ZXCZq'><q id='ZXCZq'></q></dir></style></legend>
              2. 本文介紹了GUID 的安全性如何?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                不久前,我開發了一個用戶可以購買門票的 Web 應用程序.由于我們客戶的流程運作方式,您購買后實際上得到的是一個包含票號的 URL.

                A while ago I worked on a web application where users could buy tickets. Due to the way our client's processes worked, what you effectively got as a result of your purchase was a URL with the ticket number in it.

                這些是在中東購買房產的門票,每張門票的潛在價值約為 3,000,000 美元.顯然,拋出順序整數是個壞主意.我們使用 GUID,因為它們基本上無法猜測,但我的問題是:它們足夠安全嗎?

                These were tickets to buy property in the Middle East, and each ticket was potentially worth around $3,000,000. Clearly dishing out sequential integers would have been a bad idea. We used GUIDs as they're basically unguessable, but my question is: are they secure enough?

                據我了解,.NET 生成的 GUID 完全是偽隨機的(除了一些不變的位).但是,我不知道使用什么算法來生成它們.

                As I understand it, the GUIDs .NET produces are totally pseudo-random (except for a few non-varying bits). However, I don't know what algorithm is used to generate them.

                MSDN 文檔告訴我們 Random 快速且不安全,并且 RNGCryptoServiceProvider 既慢又安全.也就是說,可以合理地假設有人可以付出足夠的努力來預測 Random 的結果,而不是 RNGCryptoServiceProvider 的結果.

                The MSDN documentation tells us that Random is fast and insecure, and RNGCryptoServiceProvider is slow and secure. That is, it's reasonable to assume someone could put in enough effort to predict the outcome of Random, but not of RNGCryptoServiceProvider.

                如果您看到足夠長的 GUID 序列,是否可以預測未來的 GUID?如果是,你需要看多少個?

                If you saw a long enough sequence of GUIDs, would it be possible to predict futures ones? If so, how many would you need to see?

                [在我們的特殊情況下,稍后會進行物理安全檢查 - 您必須出示您用來買票的護照 - 所以如果有人猜到了某人也不會糟糕else 的 GUID,所以我們當時并沒有出汗.使用 GUID 作為數據庫鍵的便利性使其成為一種有用的數據類型.]

                [In our particular case there were physical security checks later on - you had to present the passport you used to buy your ticket - so it wouldn't have been too bad if someone had guessed someone else's GUID, so we didn't sweat it at the time. The convenience of using the GUID as a database key made it a useful datatype to use.]

                所以答案是不夠".

                使用以下 0xA3 的答案,以及來自 question 他鏈接到,以下代碼將生成一個加密隨機 GUID,該 GUID 對 RFC 4122 的第 4.4 節:

                Using 0xA3's answer below, and following links from the question he linked to, the following code will generate a cryptographically random GUID that's valid by Section 4.4 of RFC 4122:

                static Guid MakeCryptoGuid()
                {
                    // Get 16 cryptographically random bytes
                    RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
                    byte[] data = new byte[16];
                    rng.GetBytes(data);
                
                    // Mark it as a version 4 GUID
                    data[7] = (byte)((data[7] | (byte)0x40) & (byte)0x4f);
                    data[8] = (byte)((data[8] | (byte)0x80) & (byte)0xbf);
                
                    return new Guid(data);
                }
                

                這比 Guid.NewGuid() 產生 GUID 的速度要慢得多,但有 122 位的非常隨機".數據,它們是安全不可預測的.

                This produces GUIDs much more slowly than Guid.NewGuid(), but with 122 bits of "very random" data, they are safely unpredictable.

                當然,任何加密隨機文本都可以作為票號,但 GUID 非常方便.:-)

                Of course, any cryptographically random text would have done for a ticket number, but GUIDs are pretty handy. :-)

                與其他版本 4 GUID 一樣,沒有絕對的唯一性保證,但幾率令人印象深刻.只要您的數量少于 326,915,130,069,135,865(即 sqrt(-22^122ln(0.99))) 個 GUID 同時運行,您可以 99% 以上確定沒有沖突.換句話說:如果像我一樣,如果您的應用程序幾乎所有內容都超過 int.MaxValue,那么您的應用程序將到處出現溢出錯誤,那么您可以超過 99.99999999999999999% 確定沒有沖突(即e^-(((2^31-1)^2)/(2*2^122))).這比您確信隕石不會在應用程序上線后的一秒鐘內消滅地球上的大部分生命(即 每億年一個).

                As with other version 4 GUIDs there's no absolute guarantee of uniqueness, but the odds are impressive. So long as you have fewer than 326,915,130,069,135,865 (i.e. sqrt(-22^122ln(0.99))) GUIDs in play simultaneously, you can be more than 99% sure there are no collisions. Put another way: if like mine your application will have overflow errors all over the place if you have more than int.MaxValue of pretty much anything, you can be more than 99.9999999999999999% sure of no collisions (i.e. e^-(((2^31-1)^2)/(2*2^122))). This is about a thousand times more sure than you can be that a meteorite won't wipe out most of life on Earth within one second of the application going live (i.e. one per 100 million years).

                推薦答案

                UUID/GUID 由 RFC4122.雖然版本 4 UUID 是從隨機數創建的 Section 6 明確安全聲明:

                UUIDs/GUIDs are specified by RFC4122. Although Version 4 UUIDs are created from random numbers Section 6 makes an explicit statement on security:

                不要假設 UUID 很難猜出;它們不應該被使用作為安全能力(僅僅擁有授權的標識符訪問),例如.一個可預測的隨機數源將加劇局勢.

                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. A predictable random number source will exacerbate the situation.

                在這個問題中也可以找到關于 GUID 隨機性的一個很好的討論:

                A good discussion of the randomness of GUIDs can also be found in this question:

                System.Guid.NewGuid() 有多隨機?(拍兩張)

                這篇關于GUID 的安全性如何?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                Calling A Button OnClick from a function(從函數調用按鈕 OnClick)
                ASP.net C# Gridview ButtonField onclick event(ASP.net C# Gridview ButtonField onclick 事件)
                Adding OnClick event to ASP.NET control(將 OnClick 事件添加到 ASP.NET 控件)
                Multiple submit Button click problem?(多個提交按鈕點擊問題?)

                  <tbody id='qpRmO'></tbody>
              3. <i id='qpRmO'><tr id='qpRmO'><dt id='qpRmO'><q id='qpRmO'><span id='qpRmO'><b id='qpRmO'><form id='qpRmO'><ins id='qpRmO'></ins><ul id='qpRmO'></ul><sub id='qpRmO'></sub></form><legend id='qpRmO'></legend><bdo id='qpRmO'><pre id='qpRmO'><center id='qpRmO'></center></pre></bdo></b><th id='qpRmO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qpRmO'><tfoot id='qpRmO'></tfoot><dl id='qpRmO'><fieldset id='qpRmO'></fieldset></dl></div>
                <legend id='qpRmO'><style id='qpRmO'><dir id='qpRmO'><q id='qpRmO'></q></dir></style></legend>

                  <small id='qpRmO'></small><noframes id='qpRmO'>

                        <bdo id='qpRmO'></bdo><ul id='qpRmO'></ul>
                        <tfoot id='qpRmO'></tfoot>
                        • 主站蜘蛛池模板: 亚洲综合成人网 | 亚洲一区二区三区免费视频 | 中文字幕成人av | 欧美一区二区免费视频 | 欧美看片 | 国产精品成人av | 欧美激情在线精品一区二区三区 | 欧美大片一区 | 亚洲一区中文字幕 | 黄a在线观看 | 国产精品一码二码三码在线 | 日韩免费视频一区二区 | 久久久久国产一区二区三区 | 国产欧美日韩综合精品一 | 日韩在线一区二区三区 | 午夜av电影 | 日韩高清一区 | 精品一区二区三区四区 | 亚洲福利一区 | 日韩一级电影免费观看 | 欧美色综合天天久久综合精品 | 伊人久久免费视频 | 天天爽综合网 | 欧美中文一区 | 精品在线观看入口 | 国产高清久久久 | 欧美国产日韩在线 | 欧美日韩成人影院 | 狠狠婷婷综合久久久久久妖精 | 国产在线一区二区三区 | 天天爱综合| 激情福利视频 | 成人aaa视频 | 久久手机在线视频 | 欧美一区二区在线观看 | 丝袜美腿一区二区三区动态图 | 精品欧美一区二区久久久伦 | 国产在线观看 | 三级黄色片在线播放 | 国产在线精品一区二区三区 | 99久久夜色精品国产亚洲96 |