差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
下次修改
前次修改
公開:20180811_tibame_ios_app資訊安全 [2018/08/11 14:47]
kent
公開:20180811_tibame_ios_app資訊安全 [2018/12/15 10:46] (目前版本)
kent
行 15: 行 15:
 [[https://​docs.google.com/​spreadsheets/​d/​1lWJeJszvQkPqZ3tLY9-ZEjtqrANw1lCOOZnjU5mfhlc/​edit?​usp=sharing|UDID登記表]] [[https://​docs.google.com/​spreadsheets/​d/​1lWJeJszvQkPqZ3tLY9-ZEjtqrANw1lCOOZnjU5mfhlc/​edit?​usp=sharing|UDID登記表]]
  
-==== Data+RNCrypt.swift (0811 1450) ====+==== DataProtection練習憑證 ​==== 
 +僅支援有登記UDID的裝置. 
 +[[https://​www.dropbox.com/​s/​q2lovjevtarpf3k/​DataProtectionDemo%E6%86%91%E8%AD%89.zip?​dl=0|憑證下載]]
 <​file>​ <​file>​
-// +Bundle ID: com.kent.dataprotectiondemo 
-//  Data+RNCryptor.swift +P12密碼: 1qaz2wsx 
-//  HelloMySecureApp +</file>
-// +
-//  Created by Kent Liu on 2018/8/11+
-//  Copyright © 2018年 SoftArts Inc. All rights reserved. +
-//+
  
 +==== 假 Pinning Hash ====
 +<​file>​
 +"​AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",​
 +"​BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB="​
 +</​file>​
 +
 +==== main.swift 預設內容 ====
 +<​file>​
 import Foundation import Foundation
-import ​RNCryptor+import ​UIKit 
 + 
 +autoreleasepool { 
 +  UIApplicationMain( 
 +    CommandLine.argc,​ 
 +    UnsafeMutableRawPointer(CommandLine.unsafeArgv) 
 +      .bindMemory( 
 +        to: UnsafeMutablePointer<​Int8>​.self,​ 
 +        capacity: Int(CommandLine.argc)),​ 
 +    nil, 
 +    NSStringFromClass(AppDelegate.self) //Or your class name 
 +  )
  
-extension Data { 
-  ​ 
-  ​ 
-  ​ 
-  func decrypt(key:​ String) -> Data? { 
-  ​ 
-    // Convert base64 encoded data to original data 
-    guard let encryptedData = Data(base64Encoded:​ self) else { 
-      print("​Fail to convert base64 to data."​) 
-      return nil 
-    } 
-    ​ 
-    guard let decryptedData = try? RNCryptor.decrypt(data:​ encryptedData,​ withPassword:​ key) else { 
-      assertionFailure("​Fail to decrypt."​) 
-      return nil 
-    } 
-    return decryptedData 
-  } 
-  ​ 
-  func decryptToString(key:​ String) -> String? { 
-    guard let data = decrypt(key:​ key) else { 
-      return nil 
-    } 
-    guard let string = String(data:​ data, encoding: .utf8) else { 
-      print("​Fail to convert data to string."​) 
-      return nil 
-    } 
-    return string 
-  } 
 } }
 </​file>​ </​file>​
  
 +==== Objective-C 混淆方式參考 ====
 +[[https://​github.com/​kaich/​codeobscure|codeobscure]]
  
 +[[https://​github.com/​kongcup/​ZMConfuse|ZMConfuse]]