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

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

      2. iOS 中的 AES256 NSString 加密

        AES256 NSString Encryption in iOS(iOS 中的 AES256 NSString 加密)
        • <small id='gjaXO'></small><noframes id='gjaXO'>

            <tfoot id='gjaXO'></tfoot>

              <tbody id='gjaXO'></tbody>

            <legend id='gjaXO'><style id='gjaXO'><dir id='gjaXO'><q id='gjaXO'></q></dir></style></legend>

              <bdo id='gjaXO'></bdo><ul id='gjaXO'></ul>
              • <i id='gjaXO'><tr id='gjaXO'><dt id='gjaXO'><q id='gjaXO'><span id='gjaXO'><b id='gjaXO'><form id='gjaXO'><ins id='gjaXO'></ins><ul id='gjaXO'></ul><sub id='gjaXO'></sub></form><legend id='gjaXO'></legend><bdo id='gjaXO'><pre id='gjaXO'><center id='gjaXO'></center></pre></bdo></b><th id='gjaXO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gjaXO'><tfoot id='gjaXO'></tfoot><dl id='gjaXO'><fieldset id='gjaXO'></fieldset></dl></div>
                  本文介紹了iOS 中的 AES256 NSString 加密的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我的應用使用 aes 256 位加密.當我運行我的項目并運行 encrypt 方法時,沒有任何內容被加密,文本字段只會自行清除.這是我的代碼:

                  My app encrypts and decrypts (or it should) an NSString (the text to be encrypted / decrypted) with another NSString (the keyword) using aes 256-Bit Encryption. When I run my project and run the encrypt method, nothing gets encrypted the textfield just clears itself. Here is the code I have:

                  -(void)EncryptText {
                      //Declare Keyword and Text
                      NSString *plainText = DataBox.text;
                      NSString *keyword = Keyword.text;
                  
                      //Convert NSString to NSData
                      NSData *plainData = [plainText dataUsingEncoding:NSUTF8StringEncoding];
                  
                      //Encrypt the Data
                      NSData *encryptedData = [plainData AESEncryptWithPassphrase:keyword];
                  
                      //Convert the NSData back to NSString
                      NSString* cypherText = [[NSString alloc] initWithData:encryptedData encoding:NSUTF8StringEncoding];
                  
                      //Place the encrypted sting inside the Data Box
                      NSLog(@"Cipher Text: %@", cypherText);
                  }
                  

                  可以通過點擊這個鏈接下載頭文件:ZIP File contains AES implementation

                  The header files can be downloaded by clicking this link: ZIP File containing AES Implementation

                  有人告訴我,我需要使用我的字符串的 Base-64 編碼來獲得任何結果.如果這是真的,那我該怎么做呢?

                  I have been told that I need to use Base-64 encoding of my string to get any result. If this is true, then how do I do it?

                  我還被告知 iOS 5 中的加密發生了變化,我的應用程序是 iOS 5+ 專用應用程序.如果這是真的,那么我必須做些什么才能使這種加密在 iOS 5 上工作,或者我在哪里可以找到另一個適用于 NSString 的 AES 256 位實現.

                  I have also been told that encryption changed in iOS 5, and my app is an iOS 5+ ONLY app. If this is true, then what do I have to do to make this encryption work on iOS 5 or where can I find another AES 256-bit implementation that will work on NSString.

                  為什么這段代碼沒有產生結果?

                  Why doesn't this code produce a result?

                  推薦答案

                  下面的鏈接指的是較舊的實現.最新版本稱為 RNCryptor.

                  您的代碼未使用 iOS 的內置 AES 實現.它有自己的自定義實現.AESEncryptWithPassphrase: 也錯誤地生成了密鑰,丟棄了密碼中的大部分熵.

                  Your code doesn't use iOS's built-in AES implementation. It has its own custom implementation. AESEncryptWithPassphrase: also incorrectly generates the key, throwing away most of the entropy in the passphrase.

                  在 iOS 上,您應該為 AES 使用 CCCrypt*() 函數.您還應該確保您了解加密和解密例程中發生的情況.編寫看起來正確的加密代碼非常容易(因為您無法通過檢查讀取輸出),但非常不安全.

                  On iOS, you should be using the CCCrypt*() functions for AES. You should also make sure that you understand what is happening in your encryption and decryption routines. It is very easy to write encryption code that looks correct (in that you cannot read the output by inspection), but is extremely insecure.

                  請參閱 Properly encrypting with AES with CommonCrypto 以了解上述問題的解釋實施,以及如何在 iOS 上正確使用 AES.請注意,iOS 5 現在有 CCKeyDerivationPBKDF 可用.

                  See Properly encrypting with AES with CommonCrypto for an explanation of the problems with the above implementation, and how to properly use AES on iOS. Note that iOS 5 now has CCKeyDerivationPBKDF available.

                  在加密之前不需要對字符串進行 Base-64 編碼.Base-64 編碼用于需要將二進制數據轉換為可以通過電子郵件或其他控制字符存在問題的地方輕松發送的形式的情況.它將 8 位二進制數據轉換為 7 位 ASCII 數據.這在這里沒有必要或有用.

                  There is no requirement to Base-64 encode your string prior to encryption. Base-64 encoding is used in cases where you need to convert binary data into a form that can be easily sent over email or other places where control characters would be a problem. It converts 8-bit binary data in 7-bit ASCII data. That's not necessary or useful here.

                  編輯:仔細閱讀有關如何使用此代碼的說明至關重要.簡單地剪切和粘貼安全代碼并希望它有效是危險的.也就是說,RNCryptManager 的完整源代碼可作為 iOS 5 編程突破極限 可能會有所幫助.這本書(盡管網站上說了什么,應該會在下周出版)包含關于如何使用此代碼的更長時間的討論,包括如何提高性能和處理非常大的數據集.

                  EDIT: It is critical that you carefully read the explanation of how to use this code. It is dangerous to simply cut and paste security code and hope it works. That said, the full source to RNCryptManager is available as part of the Chapter 11 example code for iOS 5 Programming Pushing the Limits and may be helpful . The book (which should be available next week despite what the site says) includes a much longer discussion of how to use this code, including how to improve performance and deal with very large datasets.

                  這篇關于iOS 中的 AES256 NSString 加密的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
                  Semantic Issue: Property#39;s synthesized getter follows Cocoa naming convention for returning #39;owned#39; objects(語義問題:屬性的合成 getter 遵循 Cocoa 命名約定以返回“擁有對象) - IT屋-程序員軟件開發技術分享
                  Custom font is not working in my App?(自定義字體在我的應用程序中不起作用?)
                  How to identify timezone from longitude and latitude in iOS(如何在iOS中從經度和緯度識別時區)

                      1. <legend id='uQj43'><style id='uQj43'><dir id='uQj43'><q id='uQj43'></q></dir></style></legend>
                      2. <small id='uQj43'></small><noframes id='uQj43'>

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

                            <tfoot id='uQj43'></tfoot>

                              <tbody id='uQj43'></tbody>
                          1. 主站蜘蛛池模板: 三级av网址 | 精品欧美在线观看 | 九九av| 国产欧美一区二区精品忘忧草 | 欧美午夜在线 | 一区在线视频 | 精品久久久久久久久久久院品网 | 99国产精品久久久久老师 | 国产一级片 | 亚洲精品片 | 自拍视频网站 | 久久精品超碰 | 男人av的天堂 | 亚洲国产成人精品久久久国产成人一区 | 国产1区 | 激情久久网 | 欧美一区二区三区在线观看 | 国产视频一二三区 | 日日干日日色 | 国产亚洲精品久久久久久牛牛 | 国产精品一级 | 一区二区三区高清 | 国产欧美精品 | 亚洲在线免费观看 | 高清成人免费视频 | 久久国产欧美日韩精品 | 亚洲黄色在线免费观看 | 国产福利精品一区 | 久久久国产视频 | 亚洲网址| 久国产视频 | 中文字幕国产一区 | 欧美一区免费 | 超碰97人人人人人蜜桃 | 欧美xxxx色视频在线观看免费 | 成人激情免费视频 | 亚洲精品不卡 | 欧美视频 亚洲视频 | 成人免费一区二区三区牛牛 | 久草在线在线精品观看 | 日韩资源 |