簡易檢索 / 詳目顯示

研究生: 張晴雯
Ching-Wen Chang
論文名稱: 智慧行動裝置間機密資料之同步儲存
On the Synchronization of the Secured Data Among Smart Mobile Devices
指導教授: 吳傳嘉
Chwan-Chia Wu
口試委員: 吳傳嘉
Chwan-Chia Wu
黎碧煌
Bih-Hwang Lee
張俊明
Chun-Ming Chang
學位類別: 碩士
Master
系所名稱: 電資學院 - 電機工程系
Department of Electrical Engineering
論文出版年: 2017
畢業學年度: 105
語文別: 中文
論文頁數: 150
中文關鍵詞: HTTP資料同步AES加密iOS智慧行動裝置
外文關鍵詞: HTTP, Data synchronization, Chinese, AES encryption
相關次數: 點閱:275下載:1
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 隨著科技的進步,越來越多個人資料趨於電子化,除了常見的電子信箱、
    密碼等之外,信用卡號、銀行帳戶、各式證件與網站論壇的帳號密碼等都是隨
    之產生的個人私密資訊,加上電子設備逐漸普及,一人多台電子設備是非常常
    見的事情,所以多台設備的個人資料同步管理是非常重要的課題。

    現今的私人帳號密碼管理軟體大多為透過雲端伺服器進行多台電子設備端
    的資料同步,使用的方式是先將所有個人資料都更新至雲端伺服器,再由雲端
    伺服器統一同步多台設備。但是,此種資料儲存及同步的方式有雲端資料外洩
    的風險,而本研究就是針對此種將資料上傳至雲端的資料同步方式進行研究與
    改善,透過區域網路能夠將多台電子設備的私人儲存資料進行資料傳輸及同
    步,讓使用者無需將私人資料上傳至雲端,避免資料外洩的可能風險。此外,
    本研究於區域網路同步資料之前,透過使用隨機選中的加密金鑰針對資料進行
    AES 加密,並在資料傳輸過程只傳輸加密金鑰的編號,而不將加密金鑰的內容
    透過 HTTP 傳輸,避免任何資料被攔截破解,使得資料在同步時能夠更加安
    全。

    因此,透過本研究將多台智慧行動裝置之間將機密資料進行同步與儲存,
    能夠在 Local 端將資料更新,改善雲端資料外洩的風險,並透過隨機選中的加
    密金鑰進行加密與解密,避免資料傳遞時被破解,讓使用者在管理多台行動裝
    置之個人資料同步的時候,可以更安全、更放心。


    With the advance of technology and generalization of the Internet, more and more personal information tends to be electronic. In addition to the e-mail and password, credit card number, bank accounts, all kinds of documents, forum accounts and password are also personal information. Besides, with the popularity of electronic equipment, a situation that a person has more than one smart mobile device is very common. Therefore, how to manage personal information among multiple smart mobile devices is a very important issue. Nowadays, a method most software designed is multiple devices synchronize with a cloud server. First, all the personal information is sent to a cloud server provided by a company. Second, the cloud server sends the latest information to each device. However, this method is a security risk that user’s information would be stolen easily. To tackle this problem, this research focuses on improving the method of data synchronization. Synchronizing the data on the local network among multiple devices can avoid the possibility of information from leakage because users do not need to upload private information to the cloud. In addition, before synchronizing data under the local network, this research encrypts the data by the randomly selected encryption key and only transmits the encryption key number in the data transfer process without passing the contents of the encryption key through HTTP protocol transmission. By applying this method, users don’t concern about data interception. Besides, the data synchronization process is more secure.

    As a result, the proposed method can synchronize and store confidential information among multiple smart mobile devices at the local network. Besides, it can prevent personal information from interception, and encrypt and decrypt data with randomly selected encryption keys. By using the proposed data synchronization system, users can manage their personal data without any security concern.

    摘要.............................................. I Abstract ......................................... II 第一章、緒論....................................... 1 1.1 研究背景...................................... 1 1.2 研究動機與目的................................. 5 1.3 研究內容...................................... 8 1.4 章節架構...................................... 8 第二章、 專題-系統架構 ............................ 9 2.1 iOS標準介紹 .................................. 9 2.1.1 iOS系統架構 ................................ 9 2.1.2 Xcode開發環境 .............................. 10 2.1.3 iOS 開發程式語言介紹與比較 .................. 11 2.2 iOS環境與 Objective C ........................ 12 2.3 UIKit ....................................... 15 2.4 AppDelegate ................................. 18 2.5 ViewController .............................. 22 2.6 資料庫建立基礎知識............................. 23 2.7 多畫面傳值方法................................. 29 第三章、系統規劃與設計.............................. 31 3.1 系統功能需求說明............................... 31 3.2 系統架構規劃:................................. 31 3.2.1 技術功能規劃................................. 32 3.2.2 應用功能規劃................................. 32 3.3 系統架構....................................... 33 3.4 軟體架構....................................... 35 3.3.1 系統 MVC架構 ................................ 39 第四章、資料儲存.................................... 41 4.1 基礎介紹....................................... 41 4.2 新增、編輯、刪除資料方法介紹..................... 42 4.3 資料儲存實作-iOS ............................... 44 第五章、發現設備.................................... 56 5.1 內容概要....................................... 56 5.2 IP Address 及網域搜尋範圍 ...................... 56 5.3 發現設備實作-iOS ............................... 57 5.3.1 建立 udpSocket 及 udpReceive Socket ......... 57 5.3.2 檢查 udpSocket 及 udpReceive Socket是否有錯誤. 57 5.3.3 設定與自己 IP Address 網域的搜尋範圍 .......... 58 5.3.4 StartBroadcasting ........................... 59 5.3.5 接收到 Broadcasting的處理 .................... 60 5.4 網路架構介紹.................................... 61 5.5 CocoaAsynSocket ............................... 64 5.5.1 PORT 通訊埠 .................................. 64 5.5.2 TCP 與 UDP .................................. 65 5.5.3 Socket ...................................... 65 5.5.4 Broadcast 技術............................... 66 5.5.5 CocoaAsyncSocket ............................ 68 第六章、資料同步-HTTP資料傳輸 ...................... 69 6.1 資料同步簡介.................................... 69 6.2 AFNetworking .................................. 69 6.3 JSON 介紹 ..................................... 70 6.4 建立 HTTPSessionManager ....................... 72 6.5 CocoaHTTPServer介紹 ........................... 72 6.6 HTTP資料傳輸圖 ................................ 73 6.7 資料庫同步..................................... 78 6.8 資料同步流程圖................................. 79 6.9 資料同步實作................................... 82 6.9.1 建立 HTTP Server .......................... 82 6.9.2 HTTP Server處理接收到的資料 ................ 83 6.9.3 創建一個獲取資料的 HTTPSessionManager ....... 84 6.9.4 傳送"GET /request_list" .................... 84 6.9.5 傳送"POST /update_user_account " ........... 85 6.9.6 將 Array 轉換成 JSON格式 .................... 85 6.9.7 資料同步程式說明............................. 86 第七章、資料加密................................... 89 7.1 前言.......................................... 89 7.2 密碼系統及加密技術............................. 90 7.2.1 密碼系統簡介................................. 90 7.2.2 常見加密技術簡介............................. 93 7.2.3 常見加密技術比較............................. 97 7.3 加密系統架構................................... 98 7.3.1 加密演算法選擇............................... 98 7.3.2 AES-128 .................................... 99 7.4 資料加密機制構想與實作......................... 106 第八章、操作介面設計............................... 116 8.1 登入畫面...................................... 116 8.1.1 初始化畫面.................................. 116 8.1.2 登入畫面.................................... 116 8.2 設定通訊金鑰.................................. 117 8.3 分類畫面...................................... 118 8.4 查閱資料畫面.................................. 118 8.5 新增資料...................................... 119 8.6 編輯資料...................................... 120 8.7 刪除資料...................................... 121 8.8 發現設備...................................... 121 8.9 資料同步...................................... 122 8.10 整體操作..................................... 123 8.11 討論與比較................................... 125 第九章、結論...................................... 128 9.1 結論......................................... 128 9.2 未來展望..................................... 129 參考文獻:....................................... 130

    [1] 3C 科技頻道/綜合報導,想成為手機界的 Windows?Android 市占率
    進一步壓下 iOS!, 2016 年 8 月 Available: http://3c.ltn.com.tw/news/25846
    [2] Brian Fang,寫 App程式賺錢,應該首選 iOS、Android還是 Windows
    Phone, 2014年 6月 Available: http://www.iphonenews.cc/2014/06/app-developer
    report.html [3] 中華民國內政部警政署,106年警政統計通報
    [4] 1password 官方網站 Available: https://1password.com/
    [5] KeePass官方網站 Available: http://keepass.info/
    [6] 林孟真, 主從架構 CLIENT/SERVER, Available:
    http://terms.naer.edu.tw/detail/1683117/ [7] FJU CSIE, Peer-to-Peer System, 2009年 5月, Available:
    https://sls.weco.net/node/12916h [8] 维基百科, 對等網路
    Available: https://zh.wikipedia.org/wiki/%E5%B0%8D%E7%AD%89%E7%B6%B2%E8%B7%AF [9] Apple官方網站, About the iOS Technologies
    Available: https://developer.apple.com/library/content/documentation/Miscellaneous/Conceptual/iPhoneOSTechO verview/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007898-CH1-SW1 [10] Apple官方網站,Xcode, Available: https://developer.apple.com/xcode/
    [11] ALPHA Camp, 當你努力想學習 Swift 時,全世界都會來幫你, Available:
    https://blog.alphacamp.co/2015/07/27/for-swift-beginners/ [12] 李侑儒, UI Kit 是什麼? , Available:
    http://www.gss.com.tw/index.php/focus/eis/158-eis83/1599-eis83-5 [13] 簡書, UIKit組織架構圖, 2016年 3月, Available:
    http://www.jianshu.com/p/a0e0075a75fe [14] Ole Begemann, Differences between strong and weak in Objective-C , Available: https://stackoverflow.com/questions/11013587/differences-between
    131

    strong-and-weak-in-objective-c [15] EarlySleepers, Singleton - 只要 instance一次就可以當全域變數的方法
    , 2013年 8月, Available: http://4tyone.blogspot.tw/2013/08/singleton-instance.html
    [16] JahoJiang, Stanford iOS 8 公开课笔记 <二> -- MVC模式,2016年 5月,
    Available: http://www.jianshu.com/p/5cfaa5369b15 [17] Stanford University Developing iOS 7 Apps: Lecture 1 Class Logistics, Overview of iOS, MVC, 2014年 1月, Available:
    https://www.youtube.com/watch?v=ZqKbN_C4Yvg&list=PLnOdYr35FyvhDUAIW1 7vo7nGfHJAyikUp [18] Stanford University Developing iOS 7 Apps: Lecture 1 Class Logistics, Overview of iOS, MVC, 2014年 1月, Available:
    https://www.youtube.com/watch?v=ZqKbN_C4Yvg&list=PLnOdYr35FyvhDUAIW1 7vo7nGfHJAyikUp [19] Stanford University Developing iOS 7 Apps: Lecture 1 Class Logistics, Overview of iOS, MVC, 2014年 1月, Available:
    https://www.youtube.com/watch?v=ZqKbN_C4Yvg&list=PLnOdYr35FyvhDUAIW1 7vo7nGfHJAyikUp [20] Stanford University Developing iOS 7 Apps: Lecture 1 Class Logistics, Overview of iOS, MVC, 2014年 1月, Available:
    https://www.youtube.com/watch?v=ZqKbN_C4Yvg&list=PLnOdYr35FyvhDUAIW1 7vo7nGfHJAyikUp [21] ChildhoodAndy, 深入浅出 MagicalRecord-01, 2014年 7月, Available:
    http://childhood.logdown.com/posts/208957/easy-magicalrecord-01 [22] Ed Sasena, Getting Started with MagicalRecord Available: https://www.raywenderlich.com/106856/getting-started-magicalrecord [23] Apple官方網站, Available: https://www.apple.com/tw/
    [24] 千铭, Objective-C使用@dynamic和@synthesize, 2013年, Available:
    https://my.oschina.net/qianming190729717/blog/161901 [25] Simon Ng, 養成 iOS7程式設計實力的 30堂課,博碩出版社,ISBN:978
    986-201-900-9 [26] 朱克剛,iOS9程式設計實戰,碁峯出版社,ISBN: 978-986-347-796-9
    [27] Apple Developer 官方網站, Available:
    132

    https://developer.apple.com/documentation/foundation/nspredicate [28] tonyarnold, magicalpanda/MagicalRecord , Available: https://github.com/magicalpanda/MagicalRecord [29] liuwuguigui, 使用开源库 MagicalRecord 操作 CoreData, Available:
    http://blog.csdn.net/liuwuguigui/article/details/42804923 [30] moto0421, 【Objective-C】NSDate详解及获取当前时间等常用操作, 2012年
    7月, Available: http://moto0421.iteye.com/blog/1586592
    [31] cookfront@gmail.com, Objective-C基础学习之 block , 2015年 4月,
    Available: http://cookfront.github.io/2015/04/18/objectivec-block/ [32] levinYuXiao , oc下实现局域网 udp广播通讯使用开源框架
    GCDAsyncUdpSocket , 2015年 12月, Available:
    http://www.jianshu.com/p/bcd30fa2d68c [33] CrazySteven , iOS之 GCDAsyncUdpSocket , 2016年 7月, Available:
    http://www.jianshu.com/p/99042ac1aa5f [34] 簡書, Socket通讯流程图及 GCDAsyncSocket-Demo, 2017年 1月, Available:
    http://www.jianshu.com/p/cc92bf555900 [35] Vangie Beal, The 7 Layers of the OSI Model , 2017年 1月, Available: http://www.webopedia.com/quick_ref/OSI_Layers.asp
    [36] XO, IP 位址 與 Port 編號 的觀念
    , 2008年 10月, Available: http://eoffice.im.fju.edu.tw/phpbb/viewtopic.php?t=3382
    [37] TCP與 UDP, Available:
    http://www.pcnet.idv.tw/pcnet/network/network_ip_tcp.htm [38] robbiehanson , Intro_GCDAsyncSocket , 2012年 9月, Available:
    https://github.com/robbiehanson/CocoaAsyncSocket/wiki/Intro_GCDAsyncSocket [39] HTTP 简介, Available: http://www.runoob.com/http/http-intro.html
    [40] JanzTam , AFNetworking的介绍与使用, 2015年 5月, Available:
    http://www.jianshu.com/p/a366c68d3ac6 [41] Prof. Bernd Brügge, Ph.D., iOS Client Server Communication Tutorial , Available: https://www1.in.tum.de/lehrstuhl_1/home/98-teaching/tutorials/540ios14intro-client-server-communication [42] AFNetworking Official Documentation , CocoaPods官方網站, Available:
    http://cocoadocs.org/docsets/AFNetworking/2.0.0/
    133

    [43] typedef和 Block, Available: https://zhongjcbill.gitbooks.io/ios/oc/Typedef%E5%92%8CBlock.html [44] cookfront@gmail.com, Objective-C基础学习之 block,2015 年 4 月, Available: http://cookfront.github.io/2015/04/18/objectivec-block/ [45] Introducing JSON, JSON官方網站, Available: http://www.json.org/
    [46] huliangwen, iOS 网络编程:AFNetworking, 2016年 5月, Available:
    http://www.cnblogs.com/hlwfirst/p/5496457.html [47] SomeBoy, CocoaHTTPServer 和 视频边下边播, 2016年 1月, Available:
    http://www.jianshu.com/p/962c65c7fc5a [48] 仲昇, 常見的 HTTP Method 的不同性質分析, 2015年 10月, Available:
    https://data-sci.info/2015/10/24/常見的 http-method的不同性質分析%EF%BC%9Agetpost 和其他 4種 method的差別/ [49] SJ, 淺談 HTTP Method:表單中的 GET 與 POST 有什麼差別, 2012年 2月,
    Available: https://blog.toright.com/posts/1203/淺談-http-method%EF%BC%9A表
    單中的-get-與-post-有什麼差別%EF%BC%9F.html
    [50] slowsnowscar , 99%的人都理解錯了 HTTP中 GET與 POST的區別, 2016年
    7月, Available: http://blog.csdn.net/slowsnowscar/article/details/52021775
    [51] HTML 表單中 GET 與 POST 的用法差異, Available:
    http://www.wibibi.com/info.php?tid=235 [52] Dustin Voss and Robbie Hanson, CocoaAsyncSocket ,CocoaPods 官方網站
    Available: https://cocoapods.org/pods/CocoaAsyncSocket [53] eik, Objective-C/CocoaHttpServer - Trying to do a simple GET request with one parameter , 2013年 8月, Available:https://stackoverflow.com/questions/18462937/objective-c
    cocoahttpserver-trying-to-do-a-simple-get-request-with-one-paramet [54] 密碼學原理與技術
    ( 對稱式與非對稱式密碼技術 對稱式與非對稱式密碼技術 ) , Available:
    http://avp.toko.edu.tw/docs/class/3/%E5%AF%86%E7%A2%BC%E5%AD%B8%E5 %8E%9F%E7%90%86%E8%88%87%E6%8A%80%E8%A1%93.pdf [55] 昌爸工作坊, RSA 加密 演算法 2004 年, Available:
    http://www.mathland.idv.tw/life/rsa576.htm
    134

    [56] MD5, 維基百科, Available: https://zh.wikipedia.org/wiki/MD5
    [57] SHA家族,維基百科, Available:
    https://zh.wikipedia.org/wiki/SHA%E5%AE%B6%E6%97%8F [58] ReadingLover, 密码算法详解——AES, 2015年 3月, Available:
    http://www.cnblogs.com/luop/p/4334160.html [59] brokenegg, AES加密算法图解, 2015年 3月, Available:
    http://www.ssdfans.com/?p=238 [60] 簡書, iOS中 AES对称加密(CBC模式)实现,2017年 4月, Available:
    http://www.jianshu.com/p/317c94a1a864 [61] 虛擬通路商之商業模式在數位內容產業應用之研究 —以點對點技術為基礎
    架構, 點對點(Peer to peer)技 術的市場應用模型, Available:
    https://nccur.lib.nccu.edu.tw/bitstream/140.119/34292/7/93218607.pdf

    QR CODE