簡易檢索 / 詳目顯示

研究生: 許賀凱
Ho-Kai Hsu
論文名稱: 一種應用於智慧門鎖之加解密機制
An Encryption/Decryption Scheme for Smart Locks
指導教授: 吳傳嘉
Chwan-Chia Wu
口試委員: 吳傳嘉
Chwan-Chia Wu
張俊明
Chun-Ming Chang
黎碧煌
Bih-Hwang Lee
學位類別: 碩士
Master
系所名稱: 電資學院 - 電機工程系
Department of Electrical Engineering
論文出版年: 2017
畢業學年度: 105
語文別: 中文
論文頁數: 196
中文關鍵詞: 安全遠程密碼智慧門鎖進階加密標準安全性安卓蘋果
外文關鍵詞: OnePassword, Secure Remote Password, Advanced Encryption Standard, Smart Lock, Android, iOS
相關次數: 點閱:234下載:5
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報

隨著物聯網的蓬勃發展,智慧家庭產品越來越普及。而在所有智慧家庭產品當中,智慧門鎖為智慧家庭的入門產品,只要透過科技就能讓產品更容易突顯方便性。雖然智慧門鎖作為入門產品,但卻也是家裡最重要的安全防護鎖,如何做好安全性,是智慧門鎖的一大挑戰。
本論文提出一種加解密機制智慧門鎖系統架構,其中結合One Password密碼管理器身份驗證協定Secure Remote Password、手機指紋辨識與AES加密方式,讓使用者透過指紋與手機裝置驗證身份之後與伺服器端進行身份驗證。在驗證完畢之後產生一組臨時金鑰,能在傳輸過程中加密及解密資料,確保傳輸安全,並且完成解鎖動作。此外,在本系統中設計硬體自動上鎖、手機應用程式定時登出以及計數器認證功能,增加駭客破解此系統的難度。
除此之外,本論文也設計一套權限管理的方式,如果有需要進出家門者,門鎖的管理者可以增加臨時權限,開放某時段能進出家門,如果權限失效,管理者便可刪除此權限,確保家中的安全。如果想要查看門鎖的歷史紀錄,可以透過歷史紀錄列表進行查詢。
最後,基於安全性與穩定性的考量,比較本系統與其他系統的功能差異,並實作一個不同於市面上智慧門鎖之研究。


With the vigorous development of Internet of Things, more and more smart home’s products are popular. Smart lock is a basic product of smart-home, and it could make products be easier to show the convenience via technology. Although the smart lock is an elementary product, it is the most important home’s security. Therefore, how developers build a smart lock is a huge challenge.

This paper proposes a mechanism with encryption and decryption for smart lock system which contains the One Password authentication protocol called Secure Remote Password, the fingerprint identification and the AES encryption. This system enables users to verify the identity with the mobile device through the fingerprint and server. After the authentication finishes, it will generate a set of temporary key which encrypts and decrypts the data in the transmission process which ensures the transmission’s security, and completes the unlock action. In addition, this system designed a mobile application logout-timed, a counter verification function and a hardware automatically locked which cannot be hacked.

Besides, this system also designed a set of permission management approach. If people need to enter and exit the house, the lock of the administrator can add the temporary permission for opening certain period of time to enter and exit the house. If the permission is invalid, the lock’s administrator can remove the permission to ensure safety. If you want to look the history of the lock, you can search with a list of history.

Finally, this paper based on the safety and stability considerations compares functions between this system with other systems, and builds a system different from door lock products on the market.

摘要 i Abstract ii 致謝 iii 目錄 iv 圖目錄 ix 表目錄 xvi 第一章 緒論 1 1.1 研究背景 1 1.2 研究動機 6 1.3 研究目的 8 1.4 章節架構 8 第二章 相關技術與文獻介紹 9 2.1 HTTP與HTTPS 9 2.1.1 HTTP簡介 9 2.1.2 HTTP URL 9 2.1.3 HTTPS簡介 11 2.1.4 HTTPS運作流程 11 2.2 Websocket 16 2.2.1 Websocket 原理 17 2.2.2 Websocket URI 17 2.2.3 協議請求 17 2.2.4 協議限制 19 2.3 Secure Remote Password 20 2.3.1 Secure Remote Password原理 20 2.3.2 協定驗證流程 22 2.4 MQTT 25 2.4.1 MQTT 架構 26 2.4.2 MQTT Publish/Subscribe模式 26 2.4.3 MQTT特性 27 2.4.4 MQTT命令 28 第三章 開發平台介紹 29 3.1 Android 29 3.1.1 Android 系統架構 29 3.1.2 Android 開發環境 31 3.2 iOS 32 3.2.1 iOS 系統架構 32 3.2.2 iOS 開發環境 34 3.3 Node.js 36 3.3.1 JavaScript 介紹 37 3.3.2 Node.js架構 37 3.3.3 Node.js特性 39 3.3.4 Mongo資料庫介紹 40 第四章 加密技術介紹 42 4.1 雜湊函數 42 4.1.1 SHA 43 4.2 AES加密系統 43 4.3 D-H加密系統 44 4.4 Rolling Code 45 4.4.1 Rolling Code運作技術 45 4.4.2 Rolling Code運作條件 45 第五章 系統架構設計 46 5.1 門鎖系統架構設計 47 5.2 遠程解鎖架構設計 48 5.3 近程解鎖架構設計 48 5.4 資料庫架構設計 49 5.4.1 UserSchema 50 5.4.2 LockSchema 50 5.4.3 GuestEcpirationSchema 51 5.4.4 HistorySchema 52 5.5 會員註冊流程設計 52 5.5.1 客戶端 52 5.5.2 伺服器端 53 5.6 指紋辨識流程設計 54 5.7 會員登入驗證流程設計 56 5.7.1 客戶端 56 5.7.2 伺服器端 57 5.7.3 硬體端 58 5.7.4 伺服器端接收硬體請求回應 59 5.8 解鎖流程設計 60 5.8.1 手機端UI介面初始化與解鎖控制請求 60 5.8.2 硬體端解鎖流程設計 61 5.8.3 手機端更新門鎖狀態請求流程設計 62 5.8.4 伺服器端更新門鎖狀態流程設計 64 5.9 新增與刪除權限流程設計 65 5.9.1 新增權限流程設計 66 5.9.2 刪除權限流程設計 66 5.10 顯示使用者權限清單流程設計 67 5.11 顯示歷史紀錄流程設計 68 5.12 自動上鎖流程設計 69 5.13 會員登出流程設計 70 5.14 藍芽近程解鎖流程設計 71 5.14.1 手機端藍芽解鎖初始化流程 71 5.14.2 硬體端藍芽解鎖初始化流程 72 5.14.3 硬體端藍芽解鎖流程 72 5.14.4 手機端回傳資料處理流程 73 5.14.5 手機端藍芽解鎖驗證流程 74 5.14.6 硬體端解鎖控制驗證流程 74 第六章 系統架構實作與成果 76 6.1 會員系統實作 76 6.1.1 環境架設 76 6.1.2 前置作業 76 6.1.3 登入系統Server啟動 77 6.1.4 會員系統Client成果測試 77 6.1.5 會員系統重點說明 79 6.2 身份驗證實作 83 6.2.1 測試環境 83 6.2.2 實作前置作業 83 6.2.3 Websocket-SRP Server實作測試 84 6.2.4 Websocket-SRP Client實作測試 84 6.2.5 伺服器端程式碼整合實作 85 6.2.6 手機端實作srp web 客戶端 88 6.3 AES加密套件匯入 96 6.3.1 下載AES加密套件 96 6.3.2 手機端 99 6.3.3 伺服器端與硬體端 102 6.4 門鎖初始化實作 103 6.4.1 手機端取得JS資料 103 6.4.2 手機端加密傳輸資料 103 6.4.3 手機端發送登入請求 104 6.4.4 伺服器端處理登入請求 109 6.4.5 伺服器端發送硬體初始化請求 112 6.4.6 硬體處理初始化請求 118 6.4.7 伺服器端處理硬體端回應請求 122 6.4.8 手機端接收伺服器端回應請求 123 6.4.9 實作成果 123 6.5 解鎖實作 126 6.5.1 手機端發送控制請求 126 6.5.2 硬體端處理控制請求 129 6.5.3 手機端處理硬體端回覆請求 130 6.5.4 實作成果 130 6.6 狀態更新實作 131 6.6.1 手機端發送更新請求 131 6.6.2 伺服器端處理更新請求 131 6.6.3 手機端處理伺服器端回覆請求 132 6.6.4 實作成果 132 6.7 新增、刪除使用者權限實作 134 6.7.1 新增使用者權限實作 134 6.7.2 刪除使用者權限實作 138 6.8 顯示使用者權限清單實作 141 6.8.1 手機端發送取得權限清單請求 141 6.8.2 伺服器端處理取得權限清單請求 141 6.8.3 手機端處理伺服器端回覆請求 142 6.8.4 實作成果 142 6.9 顯示歷史記錄實作 143 6.9.1 手機端發送取得歷史紀錄請求 143 6.9.2 伺服器端處理取得歷史紀錄請求 143 6.9.3 手機端處理伺服器端回覆請求 144 6.9.4 實作成果 144 6.10 自動上鎖實作 145 6.11 系統登出實作 146 6.11.1 手機端發送登出請求 146 6.11.2 伺服器端處理登出請求 146 6.11.3 手機端處理伺服器端回覆請求 147 6.11.4 實作成果 147 6.12 藍芽近程解鎖實作 148 6.12.1 手機端 148 6.12.2 硬體端 159 6.12.3 實作成果 164 第七章 系統比較與討論 168 7.1 安全性 169 7.2 穩定性 170 7.3 功能性 170 第八章 結論與未來展望 172 8.1 結論 172 8.2 未來展望 173 參考文獻 174

[1] Michael Miller, 胡為君 , 物聯網如何改變世界 , 初版 , 基峰資訊股份有限公 司, 2015, pp. 79.
[2] 程金玉 , 洋品牌智慧門鎖安全危機為何提前爆發? , 華夏經緯網 , 民 105年 8月 12日, http://big5.huaxia.com/xw/mttt/2016/08/4966289.html
[3] Website, August, AugustHomeInc, 2017, http://august.com/ http://august.com/
[4] Website, Lockitron, lockitron, https://lockitron.com/
[5] Website, Kwikset, Spectrum Brands, Inc., kwiksetlocks, 2017, https://www.kwikset.com/
[6] Marshal Rosenthal, OKIDOKEYS Smart Lock Review: Lock and App, gadgetreview, October 21, 2015, http://www.gadgetreview.com/say-ok-to-the-okidokeys-smart-lock
[7] Website, Danalock, danalockdk, https://danalock.com/
[8] Website, Best Smart Locks SafeWise Buyer’s Guide2017’s Top Electronic Keyless Door Locks, Safewise, 2017, https://www.safewise.com/resources/electronic-door-locks-buyers-guide
[9] Website, OnePassword, AgileBits, Inc., 2017, https://1password.com/
[10] 物聯網那些事 , 怎樣的 智能鎖才是安全-智能鎖安全問題探密? , 每日頭 條, 民 106年 5月 2日, https://kknews.cc/tech/z6jba2g.html
[11] 搖光智能 , 智能鎖聯網的安全性,你真相信嗎 , 每日頭條 , 民 105年 12月 30日, https://kknews.cc/zh-tw/tech/xz2eelg.html
[12] Chuck Easttom, 楊尊一 , CompTIA Security+ SY0-401專業認證手冊 , 第六 版, 基峰資訊股份有限公司 , 2014, pp. 75
175
[13] Hundre, HTTP协议详解(真的很经典) 协议详解(真的很经典) , 老李的地下室 , 民 97年 11月 3日, http://www.cnblogs.com/li0803/archive/2008/11/03/1324746.html
[14] Project_Li, HTTP协议的基本原理与机制 , segmentfault, 民 105年 8月 6日, https://segmentfault.com/a/1190000006191160
[15] CIW台灣辦事處 , 最新網路安全與 防火牆基礎 -邁向 CIW網路安全助理工 網路安全助理工 程師認證 , 初版 , 台科大圖書股份有限公司 , 2013, pp. 6-11~6-18.
[16] Mark Rhodes-Ousley, Information Security: The Complete referenceTM, Second Edition, McGraw-Hill Companies, 2013, pp. 177~178.
[17] Askeing, 淺談公鑰私、數位簽章憑證 淺談公鑰私、數位簽章憑證 , 星塵 AskeinG, 民 96年 12月 2日, http://askeing.blogspot.tw/2007/12/blog-post.html
[18] I. Fette, Google, Inc, A. Melnikov, Isode Ltd., RFC6455: The WebSocket Protocol, IETF, December 2011, https://tools.ietf.org/html/rfc6455
[19] 36nu, Websocket原理及使用場景 原理及使用場景 , 每日頭條 , 民 105年 6月 12日,
https://kknews.cc/zh-tw/tech/e9xo4r.html
[20] Tom Wu, SRP Stanford The Stanford SRP Homepage, stanford.edu,
http://srp.stanford.edu/
[21] T. Wu, RFC2945 The SRP Authentication and Key Exchange System, Stanford University, September 2000, https://www.ietf.org/rfc/rfc2945.txt
[22] D. Taylor, T. Wu, Cisco, Mavrogiannopulos, T. Perrin, RFC5054 Using the Secure Remote Password (SRP) Protocol for TLS Authentication, November 2007, https://tools.ietf.org/html/rfc5054
[23] 鄭福炯 , 物聯網技術理論與實作 , 初版 , 全華圖書股份有限公司 , 2016, pp. 184~200.
[24] Website, Android, WIKIPEDIA, 24 July 2017,
https://en.wikipedia.org/wiki/Android_(operating_system)
[25] Website, Android 基礎總結: Android系統架構 , 壹讀 , 民 105年 5月 23日,
https://read01.com/5Q2zQd.html
[26] 吳雲漢 , “一個聲控智慧家庭系統之設計 ”, 台灣科技大學電機所碩士論文 , 2016
[27] Website, 瞭解 Java 技術 , ORACLE, https://java.com/zh_TW/about/
[28] Website, Java, WIKIPEDIA, 19 June 2017, https://en.wikipedia.org/wiki/Java_(programming_language)
[29] Website, Android Studio簡單介紹與使用 , 壹讀 , 民 105年 4月 1日,
https://read01.com/kRzxBE.html
[30] 施威銘 , Android Studio App程式設計教本 之無痛起步 , 初版 , 旗標出版股份 有限公司 , 2015, pp. 1-37
[31] 劉銘 , iOS開發 程式秘訣:高手這樣Objective-C 技巧 , 初版 , 上奇資 訊股份有限公司 , 2014, pp. 1-1, 2-4~2-12, 3-3~3-4
[32] 鍾承育 , “透過 iOS應用軟體控制與 Onvif相容網路監控攝影機之研究 ”, 台 灣科技大學電機所碩士論文 , 2016
[33] 楊仁和 , Cocoa 學習手冊 學習手冊 —使用 Objective-C, 第三版 , 基峰資訊股份有限公 司, 2013, pp. 25.
[34] 朱克剛 , iOS 9+Apple Watch 程式設計實戰 —快速上手的開發技巧 快速上手的開發技巧 200+, 初 版, 基峰資訊股份有限公司 , 2016, pp. 65~66
[35] Mike Cantelon, 楊仁和 , Node.js 實戰手冊 , 初版 , 基峰資訊股份有限公司 , 2014, pp.
[36] Website, JavaScript, WIKIPEDIA, 28 July 2017, https://en.wikipedia.org/wiki/JavaScript
[37] Website, Node.js 架構概覽 , 壹讀 , 民 105年 7月 7日, https://read01.com/mddRQB.htm
[38] Website, Chrome V8, Google, https://developers.google.com/v8/
[39] Simen, Node.js 的事件迴圈與 EventEmitter, E.E.RHAP,
https://simeneer.blogspot.tw/2016/09/nodejs-eventemitter.html
[40] 趙英傑 , 超圖解物聯網 IoT實作入門 , 旗標出版股份有限公司 旗標出版股份有限公司 , 2016, pp. 8-5~8-7.
[41] Ching-Han Ho, MongoDB的 ODM:mongoose 簡單介紹 , 民 102年 9月 6日, http://blog.chh.tw/posts/mongodb-odm-mongoose/
[42] 蔡宗霖 , Java網路安全防護實務手冊|軟體開發技術的九大黃金準則 , 初版 , 基峰資訊股份有限公司 , 2015, pp. 4-2.
[43] 密碼學原理與技術 PPT, C05-101,
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
[44] 張晴雯 , “智慧行動裝置間機密資料之同”, 台灣科技大學電機所碩士 論文 , 2017
[45] E. Rescorla, RFC2631: Diffie-Hellman Key Agreement Method, RTFM Inc., June 1999, https://www.ietf.org/rfc/rfc2631.txt
[46] Website,Key Diffie–Hellman key exchange, WIKIPEDIA, 25 July 2017,
https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange
[47] Website, What is a Rolling Code?, WiseGEEK, 2017,
http://www.wisegeek.com/what-is-a-rolling-code.htm
[48] Website, Rolling Code, WIKIPEDIA, 21 June 2017,
https://en.wikipedia.org/wiki/Rolling_code
[49] Brad Traversy, loginapp, Github, https://github.com/bradtraversy/loginapp
[50] Martin Springwald, srp-web Github, https://github.com/marspr/srp-web
[51] Website, Crypto-js, Google, https://code.google.com/archive/p/crypto-js/
178
[52] Miller Lai, Python M2Crypto - AES 的 Encrypt 與 Decrypt
民 102年 8月 18日, http://ijecorp.blogspot.tw/2013/08/python-m2crypto-aes-encrypt-decrypt.html
[53] Hank Tom, Android高效入門-讀取 高效入門-讀取 JSON資料與 資料與 okHttp, 綠豆湯 , 民 105年 5月 15日, http://litotom.com/2016/05/15/android-json-okhttp/
[54] iOS, AFNetworking framework, Github,
https://github.com/AFNetworking/AFNetworking
[55] nick merrillelsehow, garage door opener, Github,
https://github.com/elsehow/garage-door-opener
[56] mqtt.js, MQTT.js, Github, https://github.com/mqttjs/MQTT.js [57] Brian Cooke, onoff, Github, https://github.com/fivdi/onoff [58] Eclipse Foundation, paho.mqtt.android, Github,
https://github.com/eclipse/paho.mqtt.android
[59] Christoph Krey, MQTT-Client-Framework, Github,
https://github.com/ckrey/MQTT-Client-Framework
[60] Website, Christoph Krey, KeyGenerator, developer.android,
https://developer.android.com/reference/javax/crypto/KeyGenerator.html
[61] Emerging Technology Advisors, node-serialport, Github,
https://github.com/EmergingTechnologyAdvisors/node-serialport
[62] Grant Ho, Derek Leung, Pratyush Mishra, Ashkan Hosseini, Dawn Song, David Wagner, “Smart Locks: Lessons for Securing Commodity Internet of Things Devices,” AsiaCCS, 2016, https://people.eecs.berkeley.edu/~grantho/papers/asiaccs2016-smartlock.pdf

QR CODE