基于Android与多媒体的英文学习APP的设计

毕业设计(论文)任务书

第1页

毕业设计(论文)题目:基于Android与多媒体技术的英文学习APP的设计与实现设计(论文)要求及原始数据(资料):1.综述国内外移动互联现状及前景;2.了解Android系统,理解Android应用程序的开发方法和步骤;3.分析该Android应用程序的模块结构和主要算法;4.熟悉开发工具的使用,完成代码编写和测试;5.训练检索文献资料和利用文献资料的能力;6.训练撰写技术文档与学位论文的能力。

第2页

毕业设计(论文)主要内容:1.综述国内外移动互联网发展现状及前景;2. 综述分析“有道英语”的可行性及具体需求;3. 综述“有道英语”APP的总体设计框架;4. 深入剖析“有道英语”APP详细设计过程中所用的关键技术; 7. 测试“有道英语”APP的各个模块的运行情况及功能模块是否基本符合要求;8. 分析并总结“有道英语”APP存在的不足之处,最后对指导老师表达致谢。 学生应交出的设计文件(论文):1.内容完整、层次清晰、叙述流畅、排版规范的毕业设计论文;2.包括毕业设计论文、源程序等内容在内的毕业设计电子文档及其它相关材料

第3页

主要参考文献(资料):商陆民,朱丹群,周然,邢海荣. 多功能电子词典软件设计[J]. 东南大学电子工程系,1995任桢.电子词典的设计研究[J]. 华中科技大学,2003黄艺锋,闫巧.基于Android平台电子词典的设计与实现[J].深圳大学计算机与软件学院,2011朱婷婷,李惠.基于Android的应用软件的综述[J] .浙江师范大学数理信息学院,2011邵明博.基于智能手机的大学英语移动学习平台研究[D]. 华中师范大学,2011尹京华,王华军 .基于Android开发的数据存储[J]. 成都理工大学信息科学与技术,2012刘锐.Android开发的性能优化[D]. 新华网股有限公司,2009Serguei A.Mokhov?,Mashrur Mia.A UI Design Case Study and a Prototype of a Travel Search Engine.Scientific American,2010J.MANI BHARATHI, S.Hemalatha, V.AISHWARYA .Advancement in Mobile Communication using Android .International Journal of Computer Applications, 2010, Vol.1 (7)Code Home.Android-An Open Handest Alliance Project.Future Generation Computer Systems,2011专业班级软件1110班学生段建生要求设计(论文)工作起止日期2015年3月23日~2015年7月3日指导教师签字日期2015年3月23日教研室主任审查签字日期系主任批准签字日期

基于Android与多媒体的英文学习APP的设计

与实现

摘 要

纵观人类的历史发展进程,总是伴随着科技的进步而演变,从石器时代到冷兵器时代再到工业时代再到互联网时代,每一次技术的更替人类的生活方式就发生一次质的变化,而如今移动互联网的时代已经到来。手机作为终端中较为轻便的一种,正在逐渐演变为一种连接一切的控制中心。英语是一种被世界上大部分国家所接受的语种,其在不同地域、不同民族、不同文化的交流中所起到的作用无可取代。在今天,英语的使用频率已经发展为仅次于母语。不同阶层对英语学习的诉求不断增强。在这样的背景下,我们应该改变传统方式,用一种更加方便的方式来实现学习英语的目的。本项目主要结合实际情况,利用Android与多媒体技术就大学生的英语学习进行了适度的群体定制,主要实现的功能模块有:词典、翻译、音频课堂、谚语名言及单词本等功能。

关键词: Android; 多媒体; 英语学习; 互联网+

Android and multimedia English study design and Implementation Based on APP

Abstract

Throughout the history of human development is always accompanied by the progress of science and technology and the evolution from the stone age to the age of cold weapons to the industrial age to the age of the Internet, every technological change the human way of life has a qualitative change, and now the mobile Internet era has arrived. During the two sessions this year, Premier Li put forward the concept of “Internet +”, also from the side once again confirms the rule. A mobile phone as the terminal is more portable, is gradually evolved into a connected all the control center. English is one of the most countries in the world have been accepted by language, in different regions, different nationalities, different cultures in the role can not be replaced. Today, the frequency of use of English has developed into the second language. Different levels of demands on English learning enhancement. In this context, we should change the traditional way, in a more convenient way to achieve the purpose of learning English. This project is mainly combined with the actual situation, the use of Android and multimedia technology on College Students English learning were moderate group customization, the main realization function module: dictionary, translation, audio classroom, saying words and word memory book and other functions.

Keywords:Android; multimedia; English learning; Internet +

目 录

1 绪论11

1.1 项目背景11

1.2 论文主要工作22

2 项目相关技术介绍与分析44

2.1 Android的发展和历史44

2.2 Android体系结构55

2.2.1 Application(应用层)55

2.2.2 Application Framework(应用框架层)55

2.2.3 Libraries(系统运行库层)55

2.2.4 Linux Kernel(Linux内核层)66

2.3 Android开发环境与工具66

2.3.1 搭建Android开发环境66

2.3.2 Android开发工具介绍1111

2.4 环境说明1111

2.4.1 编程环境1111

2.4.2 运行环境1111

3 项目可行性分析1212

3.1 可行性研究1212

3.1.1 技术可行性1212

3.1.2 经济可行性1212

3.1.3 操作可行性1212

4 项目需求分析与总体设计1313

4.1 需求分析1313

4.1.1 功能性需求分析1313

4.1.2 非功能性需求分析1313

4.2 系统总体设计及模块划分1313

4.2.1 模块划分1313

4.2.2 系统操作流程图1414

4.3 数据库设计及数据操作1515

4.3.1 数据库概念设计1616

4.3.2 数据库逻辑设计1717

4.3.3 数据库的创建1717

4.3.4 数据库的操作1717

4.3.5 数据的查看1717

5 系统的详细设计与实现1919

5.1 系统主界面的设计1919

5.2 查寻模块详细设计:2020

5.2.1 调用有道翻译API20API20API20

5.2.2 Json数据解析2121

5.3 发现模块详细设计2222

5.4 我的模块2727

6 系统的测试2929

6.1 程序的测试2929

6.1.1 欢迎界面3030

6.1.2 主界面3131

6.1.3 “词典”以及“翻译”模块3232

6.1.4 “发现”模块测试3636

6.1.5 “我的”模块测试3737

6.2 测试结果说明3838

致谢4040

参考文献4141

外文文献4242

1 绪论1.1 项目背景

随着全球化地球村时代的到来,英语成为全球化的基础交流语言,想要走出国门走向世界,英语成为每一位追梦人的必跨门槛。它对于希望拥有更宽视野的人来说,必不可少社会生活的信息化和经济的全球化,使英语的重要性日益突出。英语作为最重要的信息载体之一,已成为人类生活各个领域中使用最广泛的语言,英语能力已成为一种必备技能。学生若能学得一种外语能力,就能帮他打开进入另一个世界的学习之门,最后达成多元学习与价值的目标。从全世界来看,说英语的人数已经超过了任何语言的人数,英语在45个国家是官方语言,世界三分之一的人口讲英语,75%的电视节目是英语,四分之三的邮件是用英语书写,电脑键盘是英语键盘,任何一个会议敢号称是国际会议,其会议语言一定要用英语。此外,外贸行业也把英语作为通用语言,外贸交往、国际礼仪、书信函电、进出口文件、还有银行文件语言等,统统以英语作为标准通用语言。大多数国家的高等学府,大学院校,都开设英语语言文学专业,仅在中国,就有数百所大学设有英语专业或英语相关专业。电脑和互联网也是建立在英语的基础上,这个行业的语言,就是英语,另外,在医学领域、建筑领域、文学领域,都与英语有极大的关联。

在Twitter与Facebook出现之前,当Google还只是一个想法的时候,手机只是足够小的便携式电话,能够放在一个公文包中,电池足够用上几个小时,虽然没有多余的功能,但是手机确实使人们可以不通过物理通信线路就能自由通信。

现在、小巧、时尚而且功能强大的手机已经相当普及并且不可或缺。硬件的发展使手机在拥有更大更亮的屏幕和越来越多的外围设备的同时也变的更加小巧和高效。

作为一款Linux内核的操作系统,android系统因其移植性、跨平台性以及开放性被广大移动终端广泛使用。它涵盖移动信息设备工作所需的全部软件,包括操作系统、用户界面和应用程序。Android系统不但可以应用于智能手机,在平板电脑市场也在急速扩张。Android正在逐渐成为目前移动信息设备应用程序开发的最主要的平台。

移动互联网(MobileInternet, 简称MI)是一种通过智能移动终端,采用移动无线通信方式获取业务和服务的新兴业务,包含终端、软件和应用三个层面。终端层包括智能手机、平板电脑、电子书、MID等;软件包括操作系统、中间件、数据库和安全软件等。应用层包括休闲娱乐类、工具媒体类、商务财经类等不同应用与服务。随着技术和产业的发展,未来,LTE(长期演进,4G通信技术标准之一)和NFC(近场通信,移动支付的支撑技术)等网络传输层关键技术也将被纳入移动互联网的范畴之内。

移动互联网的多媒体信息中的应用。随着科技的进步,多媒体服务的移动用户将成为主要趋势,移动通信的发展在未来的十年。无线技术仍然在高速发展,未来空中接口的带宽不断增加,手持终端的功能将不断完善和提高,各种移动应用的发展开辟了广阔的空间。第二代数字移动通信系统发展到第三代移动通信系统是必然的趋势。移动终端用户对移动数据业务的强烈需求,和运营商也要提供更多的增值服务的设备。移动互联网的发展,需要满足统一的IP核心网的战略要求,为移动数据通信的需要移动的主要移动互联网市场。人们可以使用一些强大的掌上电脑,掌上电脑和笔记本电脑进行大量的数据处理和显示,真正满足用户的移动计算应用的需求。

4G互联网时代下,移动应用越来越多,Android 4.2.2更新包于2013年2月11日发布,未来采用Android系统手机越来越多。不仅仅在于手机,在任何移动设备上,都可以采用Android开发移植到终端设备上,例如电视、冰箱、空调、洗衣机等。将这些设备计入互联网,我们可以通过手机实时知道各个设备的状态,也可以控制它们工作。总之,Android 将带给我们更加智能、便捷、现代的生活。从而,Android应用的开发,

将会越来越庞大,需求将会越来越丰富。

1.2 论文主要工作

本论文的内容主要包括摘要、目录、绪论、Android简介及编程环境与工具、有道英语可行性分析、有道英语需求分析、有道英语APP的总体设计、有道英语APP的详细设计、有道英语APP的测试、结束语、致谢和参考文献几部分内容。

其中,绪论部分主要介绍了国内外移动互联的发展情况、课题实现的背景及意义和本论文的主要结构;Android简介及编程环境与工具部分主要介绍了编程环境的搭建,开发工具的使用;有道英语APP分析部分主要说明了该项目的可行性分析、需求分析;有道英语APP的总体设计部分主要介绍了软件每个模块的设计框架以及每个模块子模块的设计框架;有道英语APP的具体实现部分即详细设计部分,主要叙述了软件的具体实现思路、逻辑和部分主要截图及源代码;有道英语APP的测试部分主要描述了软件最后实现的效果是否满足软件设计之初的基本需求。

1.3 论文脉络

图1-1

2 项目相关技术介绍与分析2.1 Android的发展和历史

Android是以Linux为基础的开放源码的操作系统,主要应用于便携设备。最开始由Andy Rubin开发,主要支持手机。2005年由Google收购注资,并组建开放手机联盟开发一户,其逐渐扩展至平板电脑及其他领域上。2012年2月数据显示,Android占据全球智能手机操作系统市场52.5%的份额,中国市场占有率为68.4%。

Android系统版本发布时间如表2-1所示。

表2-1 Android版本发布时间

序号

时间

事件

1

2003年10月

Andy Rubin等人创建Android公司,并组建Android团队

2

2005年8月17日

Google收购了成立仅22个月的高科技企业Android

3

2007年11月5日

Google公司正式向外界展示Android操作系统

4

2008年9月22日

Google正式对外发布第一款Android手机(HTC G1)

5

2008年9月23日

Android1.0正式发布

6

2009年4月30日

Android1.5正式发布

7

2009年9月15日

Android1.6正式发布

8

2010年5月20日

Android2.2版本软件开发工具包发布

9

2010年12月7日

Android2.3版本软件开发工具包发布

10

2011年2月2日

Android3.0正式发布

11

2011年2月3日

Google发布了专用于平板电脑的Android3.0蜂巢系统

12

2011年10月19日

Google正式发布Android4.0操作系统

13

2012年6月28日

Google正式发布Android4.1操作系统

14

2012年10月30日

Google正式发布Android4.2操作系统

15

2013年7月25日

Google正式发布Android4.3操作系统

16

2013年9月4日

Google正式发布Android4.4操作系统

2.2 Android体系结构

在Android操作系统中,将体系结构划分为4层:Application(应用层)、Application Framework(应用框架层)、Libraries(系统运行库层)以及Linux Kernel(Linux内核层)。Android体系结构如图2-1所示:

图2-1 Android体系结构图

2.2.1 Application(应用层)

应用层是使用Java语言进行开发的一些应用程序,如地图软件、联系人管理、E-mail连接、浏览器等都属于应用层上运行的程序,许多开发出来的程序(如音乐播放器、通讯录等)也都是运行在应用层上的。[3]该软件(TYUT掌中行)也是运行在此层上的。

2.2.2 Application Framework(应用框架层)

应用框架层主要是Google发布的一些操作支持的类库(API框架),开发人员可以使用这些类库方便地进行程序开发,但是在开发时必须遵守框架的开发原则。而在应用框架层中也包含了众多的组件。[3]

2.2.3 Libraries(系统运行库层)

当使用Android框架层进行开发时,Android操作系统会自动使用一些C/C++的库文件来支持所使用的各个组件,使其可以更好地为程序服务。[3]

2.2.4 Linux Kernel(Linux内核层)

Android操作系统主要基于Linux2.6内核,程序的安全性、驱动程序、进程管理等都由Linux内核所提供。[3]

2.3 Android开发环境与工具

2.3.1 搭建Android开发环境

1、下载、安装JDK及测试JDK是否成功安装

下载网址:?http://www.oracle.com/technetwork/java/javase/downloads/index.html

下载界面如图2-2所示。

图2-2 JDK下载页面

我的JDK安装路径,如图2-3所示。

图2-3 JDK安装路径

JDK环境变量配置,如图2-4所示。

图2-4 JDK环境变量设置

检查JDK是否安装成功,在cmd下输入命令javac,如果出现如图2-5所示情况则为安装成功。

图2-5 JDK安装成功界面

下载并安装Eclipse下载网址:?http://www.eclipse.org/downloads/,如图2-6所示。下载完毕后直接解压,无需安装。

图2-6 eclipse下载界面

下载Android SDK下载网址:http://developer.android.com/sdk/index.html,登录该网址将会出现如图2-7所示网页,点击Download the SDK选择对应版本下载解压即可。

图2-7 SDK下载界面

安装Android开发插件

(1)打开Eclipse, 在菜单栏上选择 Help->Install New SoftWare 将会出现如图2-8所示界面。

图2-8 安装插件第一步

点击 Add按钮,出现如图2-9所示界面。其中,Name可以自己设定,此处设为“Android”,Location中输入网址:http://dl-ssl.google.com/android/eclipse/。

图2-9 安装插件第二步

点击如图2-9所示界面OK按钮,出现如图2-10所示界面。

图2-10 安装插件第三步

点击如图2-10所示界面 Next按钮,出现如图2-11所示界面。

图2-11 安装插件第四步

点击如图2-11所示界面Next按钮,出现如图2-12所示界面。

图2-12 安装插件第五步

选择I accept the terms of the license agreements 点击如图2-12所示界面Next按钮,进入安装插件界面,如图2-13所示。

图2-13 安装插件第六步 图2-14 安装插件第七步

安装完成后,提示重新启动Eclipse,点击如图2-14所示界面Yes按钮。配置Android SDK

点击Eclipse菜单window->preferences,进入如图2-15所示界面。选择SDK所在目录。点击OK。

图2-15 配置SDK

通过以上步骤,本文作者就把Android开发环境搭建好了。

2.3.2 Android开发工具介绍

任何软件的开发都离不开强大的开发工具,同理Android开发也有自己的开发工具。以下内容将简要介绍Android的开发工具。

1.JDK简介

JDK(Java Development Kit)是Sun Micro Systems针对Java开发员的产品。自从Java推出以来,JDK已经成为使用最为广泛的Java SDK。JDK 是整个Java的核心,包括了Java运行环境、Java工具和Java基础类库。

2.Eclipse简介

Eclipse 是一种基于 Java 的可扩展开源开发平台。其仅仅是一个框架和一组服务,用于通过插件组件构建开发环境。另外,Eclipse 附带了一个标准的插件集JDT(Java Development Tools),Eclipse 还包括插件开发环境PDE(Plug-in Development Environment),这个组件主要为希望扩展 Eclipse 的软件开发人员而设计。

3.ADT简介

ADT(Android Development Tools)是Android开发所用工具是Eclipse编译IDE环境中的工具,安装ADT,可以为Android开发提供便利。   

4.SDK简介

SDK(Software Development Kit)是一些被软件工程师用于为特定的软件包、软件框架、硬件平台、操作系统等建立应用软件的开发工具的集合。

2.4 环境说明

以下内容将说明本文作者开发该软件所使用的编程环境以及该软件运行的平台。

2.4.1 编程环境

本文作者用Eclipse和Android SDK(Android2.2)作为编程环境,在软件编写初期使用模拟器进行测试,后期软件逐步成熟后使用真机进行测试。

2.4.2 运行环境

软件运行在操作系统为Android2.2以上版本的手机。基本满足Android2.2系统以

上的各种型号手机(主要指屏幕适配方面)。


3 项目可行性分析

3.1 可行性研究

3.1.1 技术可行性

技术可行性分析主要分析现有技术条件能否顺利完成开发工作,硬、软件配置能否满足开发者需要等。对于Android开发,Google公司提供了良好的开发集成工具,且本文作者大学所学专业为软件工程移动互联网方向,对Android手机应用有一段时间的研究与开发经验,并且熟悉Java语言。所以该软件在开发技术这方面是可行的。

3.1.2 经济可行性

本软件开发所使用的eclipse集成环境是免费软件,这很大程度上节省了开发成本。并且在后期的实际使用过程中,太原理工大学良好的校园无线覆盖为师生使用该软件过程中需要网络连接提供很大便利。所以该软件在经济可行性方面也是满足的。

3.1.3 操作可行性

该软件的安装使用和Android应用市场的大多数应用软件类似,所以大多数用户都能够在不需进行指导的前提下方便使用该软件,并且软件系统里面都有良好的提示功能。因此从操作可行性的角度来衡量,该软件的开发是可行的。

综上可知,该软件系统在技术、经济和操作上都是可行的,满足可行性分析的要求,因此可以开发此软件系统。

4 项目需求分析与总体设计4.1 需求分析

4.1.1 功能性需求分析

通过一段时间的调研,根据反馈回来的意见,有道英语的功能需求大致定为:

a、查词并实现添加到生词本

b、翻译语句

c、四六级音频学习

4.1.2 非功能性需求分析

非功能需求有:

a、低资源消耗

手机设备CPU及内存资源相对有限,要求程序节省单词查询和翻译时所用时间以及对CPU的占用,从而节省对手机硬件资源的占用,提高程序运行的流畅度。

b、易用性

易用性是与一组规定或者潜在的用户为使用其软件所需做的努力和对这样的使用所作的评价有关的一组属性。具体包括:

? 易理解性:与用户为人质逻辑概念即其应用范围所花的努力有关的软件属性。

? 易学习性:与用户为学习软件应用所花的努力有关的软件属性。

? 易操作性:与用户为操作和运行控制所花的努力有关的软件属性。如带首字母筛选功能的下拉列表等。

4.2 系统总体设计及模块划分

4.2.1 模块划分

根据功能性需求,系统模块划分为:词典模块、翻译模块、发现模块、我的模块。对应的模块图如图4-1:

图4-1 系统模块图

4.2.2 系统操作流程图

本系统在预设的操作过程为:点击APP通过响应界面后。

第一:进入查询单词的界面,词典功能的实现是通过调用有道api进行联网查询,查询出的单词可以进行单独备份,即:录入单词本中;

第二,可以通过底部的切换卡进行,切换至翻译界面,然后可以输入对应的中英文句子,同样通过调用有道api进行联网实现翻译;

第三,通过切换卡将界面切换至发现模块,可以进行四六级音频的学习以及四六级常考的名言警句;

第四,通过切换卡将界面切换至我的模块,可以进行之前在单词查询中备份的单词进行查看,并且可以通过点击单词实现再次跳转到词典界面实现二次查询。

该软件的操作流程图如图4-2所示:

图4-2 系统操作流程图

4.3 数据库设计及数据操作

SQLite,是一款轻型的数据库,是遵守ACID的关系型数据库管理系统,它的设计目标是嵌入式的,而且目前已经在很多嵌入式产品中使用了它,它占用资源非常的低,在嵌入式设备中,可能只需要几百K的内存就够了。它能够支持Windows/Linux/Unix等等主流的操作系统,同时能够跟很多程序语言相结合,比如 Tcl、C#、PHP、Java等,还有ODBC接口,同样比起Mysql、PostgreSQL这两款开源世界著名的数据库管理系统来讲,它的处理速度比他们都快。

SQLite相关知识点:

SQLiteDatabase

一个SQLiteDatabase的实例代表一个SQLite的数据库,通过SQLite实例的一些方法,我们可以执行SQL语句,进行对数据库的增删改查。数据库对于一个应用来说是私有的,并且在一个应用当中,名字也是唯一的。

(2)SQLiteOpenHelper

这是一个抽象类。对于SQLiteOpenHelper我们通常需要继承它,并实现它里面的三个函数。

1)onCreate

在数据库第一次生成时会调用这个方法,一般我们在这个方法里生成数据库表。

2)onUpgrade

当数据库需要升级的时候,Android系统会自动调用这个方法,一般我们在这个方法里面删除数据库表,并建立新的数据库表。并且还可以根据应用需求进行其他操作。

3)onOpen

这是当打开数据库是的回调函数,一般不会用到。

本系统采用的是sqlite数据库,sqlite数据库是Android自带的小型数据库,可以将少量的数据存放在该数据库中。针对不同的用户的生词是不同的,可以很方便的将生词导入到数据库中,也可以很方便的将单词从数据库中删除。将此软件中的数据表的关系设计如下:

4.3.1 数据库概念设计

根据需求分析的结果,将本APP的数据库设计如下:

图4-3 生词表的设计

图4-4 翻译句子表的设计

图4-5历史词汇表的设计

4.3.2 数据库逻辑设计

本APP维护了3个表,并且由于为了实现简便,并没有涉及到3个表之间的交互及数据共享,因此,得到的表的结构及属性分别为:

history(_id ,query, translation ,uk ,us,explain)

sentence(_id ,JUZI ,YISI )

history(_id , query, translation, uk, us explains );

4.3.3 数据库的创建

Android 提供了标准的数据库创建方式。继承SQLiteOpenHelper ,实现onCreate() 和 onUpgrade() 两个方法,有个好处就是便于数据库版本的升级,连接数据库的算法见程序清单。数据库如果创建不成功则抛出FIleNotFoundException异常。

4.3.4 数据库的操作

Android对SQLite数据库的操作主要有插入、删除、查询操作。但是前置条件是必须打开数据库。在这里打开数据库用的主要的方法是openForReadable()和openForWriteable(),打开数据之后才能进行相关的操作,其中插入单词的方法是insert(),删除单词的方法是delete()。其详细代码见程序清单。注意:在操作完了数据库之后,需要对资源进行释放,这里就是对数据库资源进行关闭,关闭数据库的方法是close()。

4.3.5 数据的查看

Android中程序是利用Cursor游标类指向数据表中的某一项,然后进行查询数据,用Log日志显示出来。查询时用的方法是数据库本身的查询方法query(),需要注意的是这个方法比较复杂,他有8个参数,因为它将一个完整的SQL语句拆成了若干个部分:

第一个参数table:表名,相当于SQL的from后面的部分。在此还要注意

如果和多表联合查询时,就用逗号将两个表名分开,拼成一个字符串的table值。

第二个参数是columns,要查询出来的列名。相当于SQL的select后面的部分。

第三个参数是selection,查询的条件,相当于SQL的where后面的部分,在这个语句中允许使用“?”,也就是说这个用法和JDBC中的PreparedStatement的用法相似。

第四个参数selectionArgs,对应于selection的值,selection有几个问号,这里就得用几值。

第五个参数groupBy,相当于SQL的group by后面的部分。

第六个参数having,相当于SQL的having后面的部分。

第七个参数orderBy,相当于SQL的order by后面的部分,如果是倒序,或者是联合排序,可以写成类似这样:String orderBy = “id desc,name”。

第八个参数limit,指定的结果集的大小,它和Mysql的limit用法不太一样,Mysql可以指定从多少行开始之后取多少条,例如,“limit 100,10”,但是这里只支持一个数值。

5 系统的详细设计与实现5.1 系统主界面的设计

本项目的主界面的菜单栏的底部位置是通过TabHost这个组件来实现的,首先在activity_translate.xml布局文件中声明,切换卡则通过TabWidget实现,而切换卡的背景更换则是通过chat_tab_selector.xml的设置来实现,chat_tab_selector.xml的代码如下:

<?xml versinotallow=”1.0″ encoding=”utf-8″?>

<selector xmlns:android=”http://schemas.android.com/apk/res/android”>

<item android:drawable=”@drawable/ju” android:state_focused=”true”/>

<item android:drawable=”@drawable/dise” android:state_selected=”true”/>

<item android:drawable=”@drawable/dise” android:state_pressed=”true”/>

<item android:drawable=”@drawable/ju”/>

</selector>

制定完主页面布局后,在src/com.example.translate下的TranslateActivity文件中OnCreate(OnCreate方法是用来初始化Activity实例对象的)中调用布局,另外因为本activity在创建时没有继承TabActivity,因此必须在得到tabHost之后,添加标签之前调用tabHost.setup(),到现在为止顶部菜单栏的布局已经基本完成,但现在里面所对应的内容还是空的。所以就需要在这里给tabHost中添加tab内容,以第一格的tab为例,先是通过Intent的方式新建个intent1,用来实现页面的跳转的方法,然后动态用createTab()的方法添加对应切换卡内容以及跳转对象。具体代码如下:

public class TranslateActivity extends ActivityGroup {

private TabHost tabHost = null;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_translate);

tabHost = (TabHost) findViewById(R.id.trainTab);

// 如果不是继承TabActivity,则必须在得到tabHost之后,添加标签之前调用tabHost.setup()

tabHost.setup(this.getLocalActivityManager());

Intent intent1 = new Intent(this, WordActivity.class);

Intent intent2 = new Intent(this, ContentActivity.class);

Intent intent3 = new Intent(this, FxActivity.class);

Intent intent4 = new Intent(this, SCActivity.class);

createTab(“词典”, intent1.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));

// 切换时刷新Activity

createTab(“翻译”, intent2);

createTab(“发现”, intent3);

// 切换时刷新Activity

createTab(“我的”, intent4.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));

tabHost.setCurrentTab(0);

}

在上述思路下我们的详细的效果图如下:

图5-1 系统主界面

5.2 查询模块详细设计:

5.2.1 调用有道翻译API

有道翻译API,为广大开发者提供开放接口,从而降低语言理解与应用门槛。依靠有道翻译网络数据挖掘和统计机器翻译技术实力做基础,可以更加快捷的完成项目,具体代码如下:

try {

urlStr =

“http://fanyi.youdao.com/openapi.do?keyfrom=justTec&key=1249502330&type=data&doctype=json&versinotallow=1.1&q=” +URLEncoder.encode(word, “utf8”);

} catch (UnsupportedEncodingException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

5.2.2 Json数据解析

在本系统中查词和翻译调用有道接口,通过HTTP协议回传给设备,返回来的数据为标准的Json格式,再通过Json解析显示到对应的UI上。具体代码如下:

try{

String jsonData = “”;

// 向指定的URL发送Http请求

HttpResponse response = httpClient.execute(newHttpGet(urlStr));

// 取得服务器返回的响应

HttpEntity entity = response.getEntity();

BufferedReader bufferedReader =newBufferedReader(newInputStreamReader(entity.getContent()));

String line = “”;

while((line = bufferedReader.readLine()) !=null) {

jsonData = jsonData + line;

}

word =newWord();

JSONObject jsonObject =newJSONObject(jsonData);

word.setQuery(query);

word.setTranslation(jsonObject.getJSONArray(“translation”).getString(0));

JSONObject basic = jsonObject.getJSONObject(“basic”);

// 音标

word.setUk(basic.getString(“uk-phonetic”).trim());

word.setUs(basic.getString(“us-phonetic”).trim());

// 返回json数组

String otherString = “”;

JSONArray otherArray = basic.getJSONArray(“explains”);

for(inti = 0; i < otherArray.length(); i++) {

otherString += “;” + otherArray.getString(i);

}

word.setExplains(otherString.substring(1));

}catch(Exception e) {

}

模块效果截图如下:

图5-2 模块界面 图5-3 中文查词

5.3 发现模块详细设计

发现模块意在提升大学生的空闲时间利用率,因此结合大部分同学们的需求,加入了四六级听力音频以及四六级作文中经常被引用的谚语名言,最后还加入了关于我们,用来申明一些系统的信息:

四六级听力音频,主要是利用了Android自带的mediaplayer来进行定制实现,首先将所要播放的音频放入到资源raw文件夹中,然后申明出一个mediaplayer对象,通过其start(),stop()和pause()三个方法进行对应的音频的播放,停止和暂停。具体代码如下:

布局代码:

<RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android”

xmlns:tools=”http://schemas.android.com/tools”

android:layout_width=”match_parent”

android:layout_height=”match_parent”

android:paddingBottom=”@dimen/activity_vertical_margin”

android:paddingLeft=”@dimen/activity_horizontal_margin”

android:paddingRight=”@dimen/activity_horizontal_margin”

android:paddingTop=”@dimen/activity_vertical_margin”

android:background=”@drawable/mao”

tools:cnotallow=”.Cet41Activity” >

<Button

android:id=”@+id/pauseBtn”

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”

android:layout_alignParentLeft=”true”

android:layout_alignParentTop=”true”

android:layout_marginLeft=”21dp”

android:layout_marginTop=”122dp”

android:text=”暂停” />

<Button

android:id=”@+id/playBtn”

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”

android:layout_alignLeft=”@+id/pauseBtn”

android:layout_alignParentTop=”true”

android:layout_marginTop=”28dp”

android:text=”播放” />

<Button

android:id=”@+id/stopBtn”

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”

android:layout_alignLeft=”@+id/pauseBtn”

android:layout_below=”@+id/pauseBtn”

android:layout_marginTop=”46dp”

android:text=”停止” />

</RelativeLayout>

对应实现代码:

player=MediaPlayer.create(this,R.raw.cet4);

playBtn.setOnClickListener(new OnClickListener() {

public void onClick(View v) {

// TODO Auto-generated method stub

player.start();

playBtn.setEnabled(false);

stopBtn.setEnabled(true);

pauseBtn.setEnabled(true);

}

});

实现效果如下:

图5-4 音频课堂 图5-5 音频播放

b、谚语名言模块,将四六级考试中常用到的100句谚语名言整理成Excel文件,然后把Excle表中的100个英文语句与翻译写入数据库,然后通过随机函数Random()在每次启动程序从100个句子随机显示一句及其翻译。具体实现该模块的重点代码如下:

1)将Excle表中的句子导入数据库表的代码:

try {

// 读取Excel,导入到数据库

InputStream in = this.getClass().getClassLoader().getResourceAsStream

(“com/example/translate/db/juzi.xls”);

// 创建工作簿

HSSFWorkbook workBook = new HSSFWorkbook(in);

HSSFSheet sheet = workBook.getSheet(“Sheet1”);

int rows = sheet.getPhysicalNumberOfRows();

if (rows > 0) {

for (int j = 0; j < rows; j++) {

// 行循环

HSSFRow row = sheet.getRow(j);

if (row != null) {

HSSFCell cell1 = row.getCell(0,

HSSFRow.RETURN_BLANK_AS_NULL);

HSSFCell cell2 = row.getCell(1,

HSSFRow.RETURN_BLANK_AS_NULL);

ContentValues content = new ContentValues();

content.put(“JUZI”, cell1.getStringCellValue());

content.put(“YISI”, cell2.getStringCellValue());

db.insert(TABLE_SENTENCE, null, content);

}

}

}

} catch (IOException e) {

e.printStackTrace();

}

2)随机显示谚语名言的代码:

CommonBean bean = new CommonBean();

Cursor cursor = database.query(TABLE_SENTENCE, new String[] { “_id”, “JUZI”,

“YISI” }, “_id=” + CommonUtils.getRandom100(), null, null, null, null, null);

if (cursor.moveToNext()) {

bean.setId(cursor.getInt(0));

bean.setW(cursor.getString(1));

bean.setY(cursor.getString(2));

}

cursor.close();

实现效果图,如下:

图5-6

c、关于我们,将应用的一些信息呈现给用户,主要是利用了Android的AlertDialog来实现的,首先申明一个AlertDialog的builder对象,然后利用builder的setMessage()方法进行定制,具体实现代码如下:

final Builder builder=new AlertDialog.Builder(this);

gywmBtn.setOnClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

// TODO Auto-generated method stub

builder.setIcon(R.drawable.face2);

builder.setMessage(“中华人民共和国万岁!”

+ “世界人民大团结万岁!”);

builder.create().show();

}

});

实现效果如下:

图5-7

5.4 我的模块

在我的模块中有在查词过程中保存的生词,在该模块中我们可以对生词进行管理,可以删除生词以及当点击某个生词时可以再次跳转到查询该词的界面,方便二次查询。具体实现代码如下:

public View getView(final int position, View convertView, ViewGroup parent) {

if (convertView == null) {

convertView = mInflater.inflate(R.layout.scitem, null);

}

TextView id = (TextView) convertView.findViewById(R.id.id);

TextView query = (TextView) convertView.findViewById(R.id.query);

TextView translate = (TextView) convertView.findViewById(R.id.translate);

Button delete = (Button) convertView.findViewById(R.id.delete);

id.setText(String.valueOf(list.get(position).get_id()));

query.setText(list.get(position).getQuery());

translate.setText(list.get(position).getTranslation());

delete.setOnClickListener(new OnClickListener() {

@Override

public void onClick(View view) {

CommonUtils.dbAdater.deleteSc(list.get(position).get_id());

setList(CommonUtils.dbAdater.getScList());

notifyDataSetChanged();

Toast.makeText(getApplicationContext(), “删除成功”,

Toast.LENGTH_SHORT).show();

}

});

return convertView;

}

具体实现效果如图5-8所示:

图5-8

6 系统的测试6.1 程序的测试

在设计系统的过程中,存在一些错误是必然的。对于语句的语法错误,在程序运行时自动提示,并请求立即纠正,因此,这类错误比较容易发现和纠正。但另一类错误是在程序执行时由于不正确的操作或对某些数据的计算公式的逻辑错误导致的错误结果。这类错误隐蔽性强,有时会出现,有时又不出现,因此,对这一类动态发生的错误的排查是耗时费力的。

(1)测试的重要性

在实践中,软件测试的困难常常使人望而却步或敷衍了事,这是由于对测试仍然存在一些不正确的看法和错误的态度,这包括:

①认为测试工作不如设计和编码那样容易取得进展难以给测试人员某种成就感;

②以发现软件错误为目标的测试是非建设性的,甚至是破坏性的,测试中发现错位是对责任者工作的一种否定;

③测试工作枯燥无味,不能引起人们的兴趣;

④测试工作是艰苦而细致的工作;

⑤对自己编写的程序盲目自信,在发现错误后,顾虑别人对自己的开发能力的看法。

这些观点对软件测试工作是极为不利的,必须澄清认识、端正态度,才可能提高软件产品的质量。

(2)测试的目的

如果测试的目的是为了尽可能多地找出错误,那么测试就应该直接针对软件比较复杂的部分或是以前出错比较多的位置。

①软件测试是为了发现错误而执行程序的过程;

②测试是为了证明程序有错,而不是证明程序无错误;

③一个好的测试用例是在于它能发现至今未发现的错误;

④一个成功的测试是发现了至今未发现的错误的测试。

这种观点可以提醒人们测试要以查找错误为中心,而不是为了演示软件的正确功能。但是仅凭字面意思理解这一观点可能会产生误导,认为发现错误是软件测试的唯一目,查找不出错误的测试就是没有价值的,事实并非如此。

 首先,测试并不仅仅是为了要找出错误。通过分析错误产生的原因和错误的分布特征,可以帮助项目管理者发现当前所采用的软件过程的缺陷,以便改进。同时,这种分析也能帮助我们设计出有针对性地检测方法,改善测试的有效性。其次,没有发现错误的测试也是有价值的,完整的测试是评定测试质量的一种方法。与开发过程类似,测试过程也必须分步骤进行,每个步骤在逻辑上是前一个步骤的继续。大型软件系统通常由若干个子系统组成,每个子系统又由若干个模块组成。因此,大型软件系统的测试基本上由下述几个步骤组成:

(1)模块测试在这个测试步骤中所发现的往往是编码和详细设计的错误。

(2)系统测试在这个测试步骤中发现的往往是软件设计中的错误,也可能发现需求说明中的错误。

(3)验收测试在这个测试步骤中发现的往往是系统需求说明书中的错误。

模块测试主要是将软件总体的几个分模块进行独立地测试,从而发现分模块的bug并进行相关的调试。有道英语APP的模块测试主要分以下几个模块进行测试。

6.1.1 欢迎界面

测试欢迎界面图片能够显示。如图6-1所示:

图6-1 欢迎界面(清晰)

测试结果:可以正确实现首界面,界面友好显示。

6.1.2 主界面

测试主界面是否可以正确显示,如图6-3和图6-4所示:

图6-2 主界面 图6-3 主界面

测试结果:可以正确显示主界面及及其他功能界面,功能界面之间界面之间切换流畅,不会出现卡死现象的发生。

6.1.3 “词典”以及“翻译”模块

数据合理性测试:选取合理的测试数据,对查询功能进行测试。测试数据如表6-1所示。

表6-1 查询数据示例

序号

单词

测试结果

备注

1

201100-5485

无法查询

如图6-5所示

2

***

无法查询

如图6-6所示

3

good

正常查询

如图6-7所示

4

Good

正常查询

如图6-8所示

5

gOOd

正常查询

如图6-9所示

6

G89d

无法查询

如图6-10所示

7

今天天气很好

正常查询

如图6-11所示

具体步骤如下:

第一步:对测试的项目进行分析,确定测试策略,制定测试计划。计划被审核批准后转向第二步。测试工作启动前一定要确定正确的测试策略和指导方针,这些是后期开展工作的基础。只有将本次的测试目标和要求分析清楚,才能决定测试资源的投入。

第二步:设计测试用例。设计测试用例要根据测试需求和测试策略来进行,进度压力不大时,应该设计的详细,如果进度、成本压力较大,则应该保证测试用例覆盖到关键性的测试需求。该用例被批准后转向第三步。

第三步:如果满足“启动准则”(EntryCriteria),那么执行测试。执行测试主要是搭建测试环境,执行测试用例。执行测试时要进行进度控制、项目协调等工作。

第四步:提交缺陷。这里要进行缺陷审核和验证等工作。

第五步:消除软件缺陷。通常情况下,开发经理需要审核缺陷,并进行缺陷分配。进入到回归测试阶段。如果满足“完成准则”(ExitCriteria),那么正常结束测试。

第六步:撰写测试报告。对测试进行分析,总结本次的经验教训,在下一次的工作中改。

测试结果如图6-4–6-11所示:

图6-4 全为数字 图6-5 无字符

图6-6 正常拼写 图6-7 首字母大写

图6-8 大小写间插 图6-9 数字与字母间插

图6-10 正常语句 图6-11 数字与字母与中文间插

测试结果:可以正确实现查询信息错误或正确时的相关的显示结果。

6.1.4 “发现”模块测试

图6-12 “发现”界面 图6-13 音频课堂

图6-14 关于我们 图6-15 谚语名言

测试发现界面及功能是否可以正确实现,其中,主要测试的方面有:

音频课堂的界面能否正确显示,并且在播放音频上能否正确的实现播放与停止;谚语名言的界面能否正确显示,并且在名言警句的切换上能否正确顺畅的切换;关于我们的界面,能否正确的弹出系统预设的一些信息。

测试结果:可以正确实现音频播放以及谚语的切换显示。

6.1.5 “我的”模块测试

测试发现界面及功能是否可以正确实现,如图6-16和图6-17:

图6-16 生词本 图6-17 生词本

测试结果:可以正确实现单词的删除并实现生词的查找跳转。

6.2 测试结果说明

由于篇幅有限,本论文中将不能把所有测试过程一一罗列,上述测试部分只是该软件中比较重要的模块,其余模块也经过反复的测试,测试出现的问题经过反复不断的调试。主要问题及解决思路在结尾部分有所说明。经过反复的测试与调试,目前该软件已经基本可以实现需求中所需的功能,并且可以在系统为Android2.2以上版本的各种手机上友好地运行使用。


总结

本APP基本实现了设计之初的预想需求,并且在一定程度上有创新之处,当然还存在一些不足之处。下面在此做一个总结,为此后的研究做一个展望:

a、适配问题

没有做到不同屏幕,不同类型的终端的适配,由于当初界面的设定,使得本APP在一些平板上的运行效果,反而要比手机端更好,在一些屏幕较小的手机上,运行效果可能没有预期中的完美。

b、本地化问题

由于当初实现时,借助于有道api,对于运行本APP的同时,需要网络的支持,当网络断掉的时候就无法实现新词的查询,因此在使用中可能会给用户带来一定的不方便。

c、音频资源

由于在实现音频学习的板块中,使用的是android自带的mediaplayer,并且直接将音频资源打包进apk中,所以暂时只能提供为数不多的音频资源,无法实现资源的搜索,只能寄希望于版本的更新,从而更新资源库。

毕设的设计完成过程中遇到的问题远远不止如上所述,有些是用户体验不好的小问题,有些是直接让程序意外中止的大问题,这些问题只有在实践中才肯出现,仅仅是书本上的理论学习中是永远不会遇到的。另外在本次毕业设计完成的过程中,才知“书到用时方恨少”,很多时候会在一些细小的问题上出错,不经感慨自己的经验不足。白驹过隙,逝水流年,面对内功的不足,唯有加强修炼了,经过这次毕设的经历,也让自己明确了今后努力的方向。

致谢

值此论文付梓之际,心情无比激动。“饮其流而思其源,成吾学而念吾师”。四年前的秋天,我怀揣着对梦想的执着追求,成为一名大学生,并如愿成为理工学子。四年来母校的老师学识渊博,品格高尚、治学严谨、平易近人,都给我留下了深刻的印象,这些都是我今后学习工作生活中的宝贵财富,将永远激励着我不断求索前进。

感谢宋春花教授,她谦和坦荡的风范、严谨勤奋的精神以及对我悉心帮助和指导,令我由衷的感动。感谢尹珂男讲师,虽身兼数职,工作繁忙,但这段时间来从未放松过对我的教育,两位导师的谆谆教诲常在耳畔,丝丝关怀铭记心间;每有疑难,师长循循善诱,博文以礼,约我以文,总有沐浴春风、茅塞顿开之感。感谢任青松、胡莉二位老师,他们既如长者给我教诲与关怀,又如兄长与我分享生活中的得失与快乐,既是良师亦为益友;得良师益友如此,我三生之有幸。

感谢李杰、苏泽楠、韩军华等同学,与他们共同学习、探讨交流,给我的论文提出宝贵的意见和建议,对我启迪良多,情同手足,惠我实多;诸多关怀,铭记于心!感谢我的父母,他们养育了我,给予我强健的体魄和自强不息的人生信念,正是他们在背后默默的支持和鼓励,才使我得以安心学习,在此向他们表示由衷的感谢。最后感谢所有帮助我的领导、同学,你们的支持和帮助是我不懈的动力!书山有路,学海无涯。我将会在以后的人生道路上继续奋勇前进,实现自己的人生价值!

参考文献商陆民,朱丹群,周然,邢海荣. 多功能电子词典软件设计[J]. 东南大学电子工程系,1995任桢.电子词典的设计研究[J]. 华中科技大学,2003黄艺锋,闫巧.基于Android平台电子词典的设计与实现[J].深圳大学计算机与软件学院,2011朱婷婷,李惠.基于Android的应用软件的综述[J] .浙江师范大学数理信息学院,2011邵明博.基于智能手机的大学英语移动学习平台研究[D]. 华中师范大学,2011尹京华,王华军 .基于Android开发的数据存储[J]. 成都理工大学信息科学与技术,2012刘锐.Android开发的性能优化[D]. 新华网股有限公司,2009Serguei A.Mokhov,Mashrur Mia.A UI Design Case Study and a Prototype of a Travel Search Engine.Scientific American,2010J.MANI BHARATHI,S.Hemalatha,V.AISHWARYA.Advancement in Mobile Communication using Android .International Journal of Computer Applications, 2010, Vol.1 (7)

[10]Code Home.Android-An Open Handest Alliance Project.Future Generation Computer Systems,2011

外文文献

An Enhanced Dragonfly Key ExchangeProtocol against Offline

Dictionary Attack

Abstract

Dragonfly is Password Authenticated Key Exchange protocol that uses a shared session key to authenticate parties based on pre-shared secret password. It was claimed that this protocol was secure against off-line dictionary attack, but a new research has proved its vulnerability to off-line dictionary attack and proving step was applied by using “Patched Protocol” which was based on public key validation. Unfortunately, this step caused a raise in the computation cost, which made this protocol less appealing than its competitors. We proposed an alternate enhancement to keep this protocol secure without any extra computation cost that was known as “Enhanced Dragonfly”.This solution based on two-pre-shared secret passwords instead of one and the rounds between parties had compressed into two rounds instead of four. We prove that the enhanced-Dragonfly protocol is secure against off-line dictionary attacks by analyzing its security properties using the Scyther tool. A simulation was developed to measure the execution time of the enhanced protocol,which was found to be much less than the execution time of patched Dragonfly. The off-line dictionary attack time is consumed for few days if the dictionary size is 10,000. According to this, the use of the enhanced Dragonfly is more efficient than the patched Dragonfly.

Keywords:Password Authenticated Key Exchange (PAKE), Original Dragonfly,

Patched Dragonfly, Enhanced Dragonfly, Two-Pre-Shared Password

IntroductionNowadays, information is increasing at a faster rate and it needs to be secured when exchanging it over insecure networks. The most efficient way to secure this information is Cryptology which is the science of building and analyzing secret code. It consists of cryptography and cryptanalysis. Cryptography is the science that builds secret codes and cryptanalysis is the science that analyzes those codes [1]. There are two types of cryptography:Symmetric and Asymmetric key cryptography. Symmetric key cryptography has a shared key that is used by the sender and receiver in encryption and decryption processes, while Asymmetric key cryptography has a public key which is used in encryption processes and private key which is used in decryption processes .One of the symmetric cryptography protocols is key exchange protocol, which allows two parties who share non-secret information to compute a shared key via public communication. Authenticated Key Exchange (AKE) is a symmetric protocol that not only allows parties to compute the shared key but also ensures the identity of the parties where a party can compute a shared key only if he/she is the one who claims to be [3]. Another example of symmetric protocols is the Two-party Password-based Authenticated Key Exchange (2PAKE) protocol that permits two parties to generate a session key based on a pre-shared password and authenticates each other[4]. In general, PAKE protocols are exposed to different types of attacks, mainly passive and active attacks. Passive attacks are difficult to detect and are used to get information that is sent between parties without modifying the information or harming the resources. Active attacks enable the attacker to modify the encrypted message orchange the meaning of the decrypted message by creating false streams [5]. However, the most complicated type of attack is the dictionary attack regardless of whether it is offline or online. Offline dictionary attack enables the attacker to record information from successful execution of the protocol by eavesdropping on the communication between parties. Then the attacker goes offline to find the required password by trying all passwords and choosing the correct password depending on the recorded information. The interaction with the server is not required in an offline dictionary attack. Online dictionary attacks enable the attacker to find the required password by trying all passwords during the interaction with the server [6].2PAKE protocol has various types of protocols. In 1992, the first 2PAKE protocol (called the Encrypted KeyExchange (EKE)) was proposed by Bellovin and Merritt [7]. Since then, many other 2PAKE protocols have been proposed (e.g. [8]-[12]). One of these protocols was Dragonfly which was defined by Dan Harkins who claimed that this protocol had resistance to passive attacks, active attacks and offline dictionary attacks without security proofs [12]. In 2013, Dylan and Feng analyzed this protocol and proved that this protocol had weakness points in its security properties against active attack and offline dictionary attacks. They proposed to patch Dragonfly as a solution to verify its security properties by adding a public key validation [12].The main problem in the patched dragonfly protocol was that it consumed an increased computation cost during the execution of the protocol when public key was used, which involved a large bit operation. In this paper,we introduced another enhancement for the Dragonfly protocol without using a public key. The proposed solution is based on using two-pre-shared secret passwords instead of one and the number of rounds between parties has been reduced to two instead of four. This step adds more security to the original Dragonfly protocol while the attacker will require more than 1.5 days to perform the off-line attack in case the shared password is extracted from a dictionary with the size 1000. This result has been approved through a simulation project which was developed by the java programming language. The simulation project has been used to find out the required execution time by both parties who are sharing the communication. The execution time is found to be less thanthe time required in the use of public key validation. We also approved the efficiency of Enhanced-Dragonfly protocol by using the Scyther tool to analyze its security properties and its structure.The paper is organized into sections: Section 2 presents the related work; Section 3 presents review of the Dragonfly protocol; the proposed solution is presented in Section 4, while discussion is presented in Section 5.Finally, the conclusion is in Section 6. It is focused towards those who are interested in cryptography and cryptanalysis domain.Related WorkPassword Authenticated Key Exchange (PAKE) protocols have been playing an essential role in providing secure communications. As is usual in cryptography, with each new release of a protocol, attempts to attack this protocol have also been released in order to measure resistance against these attacks.In research [13], analysis of the security weaknesses of SPAKE1 and SPAKE2 protocols has been introduced.It was found that these protocols are vulnerable against password compromises, impersonation and Denialof-Service (DoS) attacks. Additionally, it was proved that the Hitchcock protocol [14], which uses public key encryptions, is insecure against momentary key compromise masquerades, Key Compromise Impersonation(KCI) attacks and off-line dictionaries. To remove these disadvantages, a new efficient protocol has been designed which relies on two-party PAKE protocols based on symmetric key exchange protocol and multiple hashfunction calculations. The public key scheme has been replaced here with the symmetric encryption because thelatter requires fewer bit operations. Many theories have been explained to prove that the proposed scheme is secure against various attacks. It provides the mutual authentication and forward secrecy attributes with many other security attributes. However, there is a little increase in computational costs that was caused by the extra hash calculations. This may be deemed negligible when considering the efficiency of the extra security attributes and lower number of rounds.Moreover, another research [15] introduced the vulnerabilities of SPEKE and EKE protocols and analyzed them due to theoretical practices. In addition, a new PAKE protocol was proposed and was called Password Authenticated Key Exchange by Juggling (J-PAKE). It depends on shared secret-password between two entities and it has two rounds to create a strong shared key. It is based on well-established primitive in cryptography called Zero-Knowledge Proof (ZKP) that allows a person to prove his knowledge of a discrete logarithm without revealing it. The analysis of this protocol proved that it prevents off-line dictionary attacks, limits an active attacker to guess only one password per protocol execution and provides forward secrecy. It has advantages like:protection of users from leaking passwords and it does not require PKI deployments. This protocol is very efficientaccording to the use of well-established primitives.Recent researches in the field of PAKE protocols are moving towards using Public Key Infrastructure (PKI) in the authentication process. In recent years, PAKE has been used with RSA encryption method to provide the appropriate secrecy between two parties. In [16] a new proposed protocol named as E3PAKE-RSA, which is based on RSA scheme with the three-party model that enables two entities to only need to remember a humanmemorablepassword to authenticate each other and agree on a large session key with the assistance of the trusted server. The public/private key parameters are selected by the clients rather than a trusted distribution center, which makes the process of on-line authentication obsolete. It was predicted that the computation cost for this protocol would be respectively high according to the two-party RSA-PAKE. However, during the testing phase, which applied to the generic constructions, the computation cost of E3PAKE-RSA protocol was found to be as much as the two-party RSA-PAKE and the number of total rounds are less than this. Actually, this protocol requires more time to execute due to the use of the RSA encryption method and the long bit operations, while the other PAKE protocols (which do not use PKI) work faster.Overview on Dragonfly ProtocolDragonfly is a PAKE protocol that is used to exchange session keys between two parties with mutual authentication inside mesh networks. It was defined by Dan [12]. Finite cyclic groups are required to implement dragonfly such as Finite Field Cryptography (FFC) or Elliptic Curve Cryptography (ECC) [17]. This paper implements this protocol by using FFC. A finite field is “a field F that contains a finite number of elements which is the order of F” [18]. More details about finite field are presented in.In this section, we will explain the Dragonfly protocol in detail, with the discovered attack on it followed bythe solution which is suggested in [12].The Proposed Solution

This paper proposes a solution to secure the original Dragonfly protocol without the addition of public key in order to keep the execution time as fast as possible. It relies on using two pre-shared passwords instead of one. Here the attacker must search for each N, P in the dictionary. The first password P will be generated in the same way as in the original Dragonfly protocol. This is done by extracting a string from the dictionary and using the

identities of both parties. It has a length of 1024 bits. The generation of the second password N is the same as Pbut with two minor changes; which are based on the extraction of another word from the same dictionary and the use of the identity of the respondent and it has a length of 160 bits instead of 1024.

The enhanced Dragonfly protocol will work according to the following steps:

Two passwords will be generated, which are P and N, and will be shared between both parties.Both parties produce scalar and element operations based on choosing one scalar that belongs to Q randomly(r). Then each party will compute his/her scalar (A,B) = r(A,B) + N and element operations E = P – N.Both parties will compute the hash value of E which is E’ = H (E).The first party will compute the hash value A for the parameters E’ and sA. Then A will be sent to the second party with the scalar value of the first party. The second party will verify the hash value A to ensure the authentication process. Here if the hash value is verified then the second party will compute the hash value B and send it to the first party with his/her scalar value SB, otherwise it will be declined. The first party in turn will verify the hash value B. If it is valid then the authentication succeeds.After that each party will calculate the shared secret which is ss = (PsB E)rAThen they create a shared secret key which is K = H(ss|E|(sA + sB) mod q).

The benefits of this solution are: firstly, the attacker will never be able to guess the hash value which includes the hash of the element value that uses the exponent of two-secret values. Secondly, the authentication processoccurs in two rounds rather than four rounds as in the original protocol. This elimination makes the execution process go faster. The steps of enhanced Dragonfly protocol have been displayed in Figure 2.

4.1. Methodology over Protocol Testing

A simulation project has been developed to test the time needed to execute the protocol compared to the patched dragonfly protocol. It was written in Java and maintained in Net Beans. This project has been handled by using 64 bits Windows 8.1 pro-operating system and a processor with the speed 2.38 GHz. This project includes three various classes:

Dragonfly: is the main class that has objects from the other two classes and it also has some local variables

such as:

? ID_A, ID_B are identities of initiator and respondent. The identity is the Mac address. For example ID_A =

001CB3098515, ID_B = 001AB3008600.

3) EnhancedDragonfly: is the class that implements the proposed solution. It works as the initiator agent,which is Alice. The respondent agent which is Bob will follow the same steps that are provided by this class.First, a random value rA will be selected from {1,…,q} while q is a Subgroup Order as shown in Table 2. The

passed P and N will be used with rA to calculate Scalar sA, Element E and hash value A. Then these values will be used to calculate the shared secret key. We use MD5 for hash function.

This class includes seven methods:

Enhanced Dragonfly is the constructor that takes p_modularandq as parameters.scalar_operation: it is calculating scalar operation that is sA = rA + Nelement_operation: it is calculating element operation that is E = P Nsending_operation: it is used to calculate and send the hash value Averifying_operation: It returns true or false according to the verification of the hash value of the other party.sharedsecret_computation: used to calculate the shared secret key ss, which will be used later in the next equation.sharedkey_computation: returns the secret key in the form of hash value.

The class diagram of this project is displayed in Figure 3, while Figure 4 presents the input and output of Enhanced Dragonfly protocol simulation. The values of important parameters of Enhanced Dragonfly protocol simulation are listed in Table 2.

By applying this simulation, the execution time for one participant was found to be 19 minutes only. This experiment was applied 15 times in order to measure the total execution time of the enhanced Dragonfly protocol and the average of the total time is almost 38 minutes. This result works as a proof for the efficiency of the proposed solution, and the use of two-shared passwords will not affect the time of exchanging the secret keys.

4.2. Testing and Analysis of the Enhanced Dragonfly Protocol

Any protocol should be analyzed in order to see if there are any possible attacks that can occur and find how secure it is. The automatic analysis is the most recent approach which is used in analysis of security protocols and it is more efficient than the manual one. The required time to write the protocol description depends on the

learning of its language. All possible attacks will be tested by the used tool. The automatic analysis will be used in this research. Various tools are used to analyze the security protocols and to check the possibility of any attack can happen when protocol is put to use. An example for this is the Scyther tool which supports the evaluation of protocols with respect to these corruption models which have led to the automatic detection of many attacks that previously could only be found by manual analysis [22].

4.2.1. Description of Scyther Tool and SPDL

Scyther [23] is one of the most efficient analyzing tools compared with other tools [24]. It was found that this tool can discover attacks more efficiently than others and it can also verify protocols with an unlimited numberof sessions. Its run time is also less than others. There are many protocols that have been analyzed by this tool such as IKEv1, IKEv2 protocol suits, ISO/IEC 9798 family of authentication protocols and MQV family of protocols.

The Scyther tool takes the protocol description as input, and outputs a summary report stating whether the claim was true or false, whether any attack was found or not, and optionally, visual graph descriptions in the dot language from the GraphVizlibrary or representations of trace patterns in XML which describe the trace pattern[25]. Additionally, there are a set of Python bindings for the Scyther command-line tool, which provide a convenient means to script Scyther experiments. Figure 5 displays how this tool works.

Security Protocol Description Language (SPDL) is a language that is used in Scyther for writing a protocol[26]. This language is just expressive enough to capture the most relevant security protocols in an abstract way.It allows us to develop high-level reasoning methods and tools, which can be applied to a large class of protocols.SPDL is used to create a definition for existing protocols that use symmetric or asymmetric encryption. It includes three scopes; global scope (the largest scope), protocol scope (smaller than global) and role scope (thesmallest one). Furthermore, it includes the initial knowledge required to execute a role (each agent’s role includessequence of events, such as sending or receiving a message), the declaration of functions, global constants and variables.

4.2.2. SPDL of Enhanced Dragonfly Protocol and Analysis Result

In this sub-section, the SPDL representation of Enhanced Dragonfly protocol will be explained in detail. After that, the findings from this analysis will be discussed. The SPDL code of the enhanced dragonfly is displayed in Figure 6. First of all, a global hash function H1 & H2 has been defined (outside the protocol definition) to make it available to be accessed by all rolls in the protocol. Also, the functions of multiplication mult, addition add,

exponential exp and the inverse inv were defined globally. Function is a special type which defines a function term that can take a list of variables. By default, it behaves like a hash function: given the term H1(x) where H1 is of type Function, it is impossible to derive x. These functions are defined in an abstract way in SPDL, which doesn’t support any real equations.

Next, the protocol description starts with the keyword protocol which takes the role names as parameters.There are three rolls, namely; the key generator center (role KGC), the initiator (role A) and the respondent (role

B):

? Key generator center role KGC [27]: Used here to pass the shared secret password P and N to role A and B. The way of generation, which is used to generate these shared passwords, doesn’t take a place here in the tool because the tool depends on the structure of the protocol only. The shared secret passwords P&N have been identified as constants and their scope is within the protocol because they should be used inside all

roles.

? Initiator role A:

? This role represents the start of the communication to compute the shared secret key. The selection of random

value rA, which is the first step in the protocol structure (see Figure 2) by Alice (initiator), has been

clarified by using the fresh declaration which is used by SPDL to get random values. Nonce is a standard

data type that is often used in Scyther tool.

? The calculation of SA (Scalar value), E (element value), and A1 (hash value) occurs by using the predefined

functions, and then SA and A1 will be sent to role B.

? Note: labels in recv and send need to disambiguate similar occurrences of events in a protocol specification.

In addition, they are used to link each send event with its recv one [28].

? In the received event of role A, the hash value of B and the Scalar value SB will be saved in a Ticket variable,which can be substituted by any term.Role A will verify if these values are from Role B or not by using the match function. The definition of match [29] ensures the new variable assignment equivalent to the old one and it returns true or false. If the returned value is true then the next steps computed, otherwise Role A will conclude that this value is not from the honest agent, and it closes the session.

? The calculation of the secret key needs to be kept in secrecy, so that a claim with the type secret is used. The main idea behind claim events is locality [28] [29]: that a term is not in the adversary knowledge, or any certain role in run. Secrecy means that if an agent communicates with non-compromised agents, the term should be secret in every trace of the protocol. Secrecy expresses that certain information is not revealed to an adversary, even though this data is communicated over an un-trusted network. Here, claim event has been

used to keep session’s key secret and is known to role A only. When the tool runs, it tries to find the corresponding attack to each claim.

? Respondent Role B:

? Generates the random value rB by fresh declaration.

? Calculates the scalar SB, Element E and hash value B1 and sends it to Role A.

? Verifies the received hash value from Role A and compares it by using match function.

If the output of matching is true, then B will calculate the secret session key and claim it with secret type.The SPDL of the protocol is inserted into the Scyther tool to see if any attack could occur or if there is any structural weak point in this proposed protocol. The result of this analysis brings out that there is NO attack found. All roles are verified, which means that no impersonation can occur during the connection and the characteristics of the protocol structure are verified. This means that the way of exchanging the data is totally secure.This result is printed in Figure 7 and Figure 8.

5、Discussion

5.1. Off-Line Attack Simulation

Attack class has been applied to previous simulation projects. This class works by measuring the time taken to check all possible passwords, as dictionary size varies from 100, 1000 to 100,000 words. Each experiment was performed 5 times to find the search time by attack class and the average value was taken. As a result, the average time of this search within the enhanced protocol increased linearly as with increase in the dictionary size. The average time of off-line search when the dictionary length is 10,000 is more than 1.5 days, and with the

original Dragonfly protocol [12] the off-line search algorithm took an average of 25 seconds to find the correct password with the same dictionary length. This is because the enhanced protocol has an exponential relationship between the two-secret passwords in thecomputation of the element variable. Therefore, the attacker will be forced to search for two words instead of one. As a comparison between the time that is required for searching one password and the time required for searching two passwords, this experiment found that the time increased

exponentially. The search of such an attack on the patched Dragonfly protocol requires few days to be successful. However, here the execution time will have an impact on the efficiency of Key exchange technique. Table 3 shows a linear relationship between dictionary size and the time taken to try all passwords.

5.2. Comparison between Enhanced Dragonfly and Patched Dragonfly Protocols

The enhanced Dragonfly protocol is very similar to the patched Dragonfly protocol except for two minor changes. Firstly, the patched protocol uses only one shared password and a public key, while the enhanced protocol uses two-shared passwords. Second, the rounds between the initiator and the respondent are only two rounds in the enhanced protocol while it is four rounds in the patched protocol. However, the patched dragonfly involves some computational cost because it is uses a public key validation which creates large bit operations due to its large size. This can decrease the protocol efficiency and make it less appealing than its competitors[12]. Otherwise, in the enhanced dragonfly protocol, the execution of the protocol will take less time. In order to measure the execution time of the enhanced Dragonfly protocol we used the simulation project to compute the time required by the key generation center that uses dictionary size 10,000 plus the time which required by the

initiator party when execute the required computation of the protocol. The cost of both patched and enhanced Dragonfly protocol for each participant has been placed into Table 4, and based on these time measurements we have observed that the efficiency of using two-shared passwords is more than using the public key.

The limitation of this research is that these results are based on a normal speed machine with the 64 bits Windows 8.1 pro-operating system and a processor with the speed of 2.38 GHz which is not the case in the real time attack. Furthermore, the attacker is likely to significantly shorten the time of exhaustive search by distributing the calculation over several high performance machines.

6Conclusion

In this research we proved that the Dragonfly protocol can be enhanced in a way, other than the public key validation,to make it secure against off-line dictionary attacks. The proposed solution that has been introduced to the original Dragonfly protocol relies on the use of two-shared secret passwords P and N. This solution works by the use of an exponential relationship between these passwords and performing the authentication process in two

rounds only instead of four, which positively affects its efficiency. The use of public key validation, which is proposed in the patched protocol, is causing a computational cost to its execution that makes it less efficient.However, the execution time of the enhanced Dragonfly protocol and the time of an off-line dictionary attack were measured in the developed simulation project. As a result of this simulation, the required time to execute the enhanced protocol for one of the parties was 19 ms, while it was 64 ms in the patched protocol.

一个增强的蜻蜓密钥交换协议对离线

字典攻 击

摘 要

蜻蜓的口令认证密钥交换协议使用一个共享的会话密钥进行身份验证,基于预共享秘密的密码。据称,该协议是安全的对离线字典攻击,但一项新的研究已证明离线字典攻击和证明步骤的漏洞是采用“修补”协议是基于公共密钥验证。不幸的是,这一步在计算成本引发,使这个协议比其竞争对手缺乏吸引力。我们提出了把这个协议没有任何额外的计算成本,被称为“增强的蜻蜓”的另一种增强。该解决方案基于预共享密钥的密码而不是一轮双方已经压缩成两轮而不是四。我们证明了蜻蜓的协议是安全的离线字典攻击,利用飞天螳螂工具分析其安全性能。开发了模拟测量增强协议的执行时间,这被认为是比修补的蜻蜓的执行时间少。离线字典攻击的时间是几天消耗如果字典的大小是10000。根据这个,对增强蜻蜓的使用要比修补蜻蜓更有效。

关键词:口令认证密钥交换(交换); 原蜻蜓; 打补丁的蜻蜓;

蜻蜓的增强; 两预共享密码

1 介绍

如今,信息以更快的速度增加,它需要保护时,它在不安全的网络交换。为了保护这些信息的最有效方法是密码是密码科学的建立与分析。它包括密码学和密码分析。密码是建立密码和密码分析是科学分析这些代码[科学] 1。有两种类型的密码:

对称和非对称密钥加密。对称密钥密码体制有一个共享密钥,加密和解密过程是由发送者和接收者,而非对称密钥加密也用于加密过程和私有密钥用于解密公钥的过程。

一种对称密码协议的密钥交换协议,允许双方谁分享非机密信息来计算共享密钥通过公共通信。认证密钥交换(阿克)是一个对称的协议,不仅使双方计算共享密钥并保证当事人身份当事人可以计算共享密钥只有他/她是一个自称。另一个例子是对称协议的两方基于口令认证的密钥交换(2PAKE)协议,允许双方产生一个基于预共享密码和验证对方会话密钥。一般来说,PAKE协议在不同的攻击类型,主要是被动攻击和主动攻击。被动攻击难以检测和得到信息发送当事人之间无需修改信息或破坏资源。主动攻击使攻击者修改加密解密的消息或改变的意义创造虚假的流。然而,攻击的最复杂的类型是字典攻击,无论是离线或在线。离线字典攻击使攻击者记录信息从协议成功执行的当事人之间的通信进行窃听。然后攻击者脱机尝试所有的密码和选择正确的密码,根据记录的信息找到所需要的密码。与服务器的交互是不需要离线字典攻击。在线字典攻击使攻击者通过尝试所有的密码与服务器的互动中找到所需的密码。

有不同类型的协议2PAKE协议。1992,第一2PAKE协议(称为加密密钥交换(EKE))是由 Bellovin和梅利特提出的。自那时以来,许多其他的2PAKE协议被提出。这一协议是蜻蜓是由丹哈金斯声称此协议具有抵抗被动攻击的定义,主动攻击和离线字典攻击没有安全证明。2013,迪伦与冯分析该协议证明了该协议的安全性能对主动攻击和离线字典攻击有弱点。他们建议补丁蜻蜓作为解决通过添加一个公共密钥验证验证其安全性能。

在修补蜻蜓协议的主要问题是,它消耗的运算成本增加在协议执行时,公共密钥的使用,这涉及到一个大的位操作。在本文中,我们介绍了蜻蜓的另一个增强的协议不使用公共密钥。提出的解决方案是基于使用两个预共享密钥密码而不是一轮数,双方已减少到两个而不是四个。这一步增加了更多的安全到原蜻蜓协议而攻击者将需要超过1.5天的情况下,共享密码是从一个以大小1000词典提取执行离线攻击。这一结果已通过仿真项目是由Java编程语言开发。仿真项目已被用来找出所需的执行时间由双方分享通信。执行时间是小于在使用公共密钥验证所需的时间。我们也同意用飞天螳螂的工具来分析其安全性能和结构增强蜻蜓协议的效率。

本文共分部分:2部分介绍了相关的工作;3部分介绍了蜻蜓的协议的审查;4部分提出了解决方案,同时讨论在第5节。最后,得出的结论是在6节。这是针对那些有兴趣在密码学和密码分析领域。

2 相关工作

口令认证密钥交换(PAKE)协议已提供安全的通信,起到了至关重要的作用。通常是在密码学中,有一个协议的新版本,试图攻击该协议也被释放,为了衡量抵抗这些攻击。在研究对spake1和spake2协议的安全缺陷分析介绍了。发现这些协议对密码的妥协是脆弱的,模仿和对服务(DOS)攻击。此外,证明了希区柯克协议,使用公钥加密,不能抵抗密钥泄露伪装一时,密钥泄露(KCI)和离线字典攻击。为了消除这些缺点,一种新的有效的协议,设计了基于对称密钥交换协议和多个哈希函数计算两方PAKE协议。公钥方案已经取代了这里的对称加密,因为后者需要较少的位操作。有许多理论解释,证明该方案对各种攻击的安全。它提供了相互身份验证和保密性等安全属性的属性。然而,在计算成本的额外的哈希计算造成略有增加。这可能被视为微不足道的考虑额外的安全属性和轮数的效率低。此外,另一个研究介绍了斯皮克的漏洞和EKE协议和分析由于理论实践。此外,一个新的PAKE协议提出了被称为密码认证密钥交换的杂耍(j-pake)。这取决于共享密钥密码两实体和它有两轮创建一个强之间的共享密钥。它是基于成熟的原始密码“零知识证明(ZKP)使人能证明他没有透露它的离散对数知识。这一协议的分析证明,它可以防止离线字典攻击,限制主动攻击者猜测每个协议的执行只有一个密码,提供了保密。它的优点是:泄漏用户密码保护,它不需要PKI的部署。该协议是非常有效的根据既定的原语的使用。

在领域的最新研究PAKE协议对使用公共密钥基础设施(PKI)在认证过程。近年来,园区已使用RSA加密算法提供了双方之间的适当的保密。在[ 16 ]提出了一种新的协议称为e3pake-rsa,这是基于三方模型,使两个实体,只需要记住一个humanmemorable RSA方案互相验证并在可信服务器的帮助大会话密钥一致的密码。公共/私人密钥参数由客户而不是一个值得信赖的配送中心的选择,使得在线认证淘汰的过程。据预测,该协议的计算成本将分别根据两方rsa-pake。然而,在测试阶段,适用于通用的结构,e3pake-rsa协议的计算成本是一样的两方rsa-pake和总轮数少于这。实际上,这个协议需要更多的时间来执行针对RSA加密方法的使用和长期的位操作,而其他的PAKE协议(不使用PKI)工作得更快。

3 蜻蜓协议概述

蜻蜓是一种用来交换会话密钥的双方之间的相互认证网格内部网络交换协议。它是由丹[定义] 12。有限循环群都需要实现蜻蜓如有限域密码(FFC)或椭圆曲线密码体制(ECC)[ 17 ]。本文采用FFC实施该协议。有限的领域是“一场F包含有限数目的元素的顺序是F”[ 18 ]。关于有限域的更多详情。在本节中,我们将详细讲解蜻蜓的协议,以发现攻击它所遵循的解决方案是在[ 12建议]。

4 提出的解决方案

本文提出了一种解决安全原蜻蜓协议没有为公钥保持执行时间尽可能快的加入。它依赖于使用两个预共享密码而不是一个。在这里,攻击者必须寻找每一个N,P在字典。第一个密码P会产生相同的方式在原蜻蜓协议。这是通过提取从字典字符串并使用

双方的身份。它有一个长度为1024位。第二密码n为两小变化但相同的产生;这是基于相同的字典和答辩人的身份和使用它有一个长度为160位而不是1024提取的另一个词。

增强的蜻蜓协议将按以下步骤的工作:

1)两个密码将产生,这是P和N,并将双方之间的共享。

2)双方产生标量和单元操作的基础上选择一个标量属于Q随机(R)。然后,每一方将计算他/她的标量(A,B)= R(A,B)+ N和E = P元素操作–N.

3)双方将计算出的哈希值E = H(E)。

4)甲方将计算哈希值的参数E和SA。然后将发送给乙方与甲方的标量值。乙方将验证哈希值来保证认证过程。如果哈希值进行验证,则乙方将计算哈希值B寄给甲方与他/她的标量值某人这里,否则将被拒绝。反过来,甲方将验证哈希值,如果它是有效的,认证成功。

5)之后,每一方将计算共享密钥是SS =(PSB E)RA

6)然后创建一个共享密钥,K = H(SS | E |(SA某人)mod q)。

这种方案的好处是:首先,攻击者无法猜测的哈希值,包括使用两个秘密值指数的元素值的哈希。其次,在两轮而不是四轮在原协议的认证processoccurs。这使得执行过程更快的消除。增强的蜻蜓协议的步骤已经在图2中显示的。

4.1 在协议测试方法

一个模拟项目已开发测试需要执行协议相比,修补的蜻蜓协议的时间。这是写在Java和保持净豆。该项目已通过使用64位的Windows 8.1 Pro操作系统处理和与速度2.38 GHz处理器。该项目包括三个不同的类别:

1)蜻蜓:是从其他两类主要的类,对象,它也有一些局部变量,如:

?id_a,id_b是引发剂和被申请人的身份。身份是MAC地址。例如id_a =

001cb3098515,id_b = 001ab3008600。

3)enhanceddragonfly:是执行方案的类。它作为引发剂,这是爱丽丝。被告代理这是鲍勃将遵循由这类提供相同的步骤。首先,一个随机值RA将选自{ 1,……Q },而Q是一个子群顺序如表2所示。的

通过P和N将用于RA计算标量SA,元和散列值,然后将这些值用于共享密钥计算。我们使用MD5哈希函数。

这一类包括七种方法:

1)增强的蜻蜓是以p_modularandq作为参数的构造函数。

2)scalar_operation:它是计算标量运算,SA RA + N =

3)element_operation:它是计算单元操作,E = P n

4)sending_operation:它是用来计算哈希值并发送

5)verifying_operation:它返回true或false根据对方的散列值的验证。

6)sharedsecret_computation:用来计算共享密钥的SS,这将会在接下来的方程后用。

7)sharedkey_computation:返回的哈希值形式的密钥。

这个项目的类关系图显示在图3中,图4给出了输入和输出增强蜻蜓协议仿真。增强的蜻蜓协议仿真的重要参数列于表2。

通过这种模拟,一个参与者的执行时间是19分钟。本实验应用15次为了测量增强蜻蜓协议的总执行时间和总时间平均约38分钟。这一结果作为建议的解决方案的效率的一个证明,和两个共享密码的使用不会影响的密钥交换时间。

4.2 蜻蜓的增强协议测试与分析

任何协议应进行分析,以查看是否有任何可能的攻击,可以发现它是多么的安全。自动分析的最新方法,用于安全协议分析和它比人工更高效。所需的时间写协议的描述取决于

其语言学习。所有可能的攻击将被用来测试工具。自动分析进行研究。各种工具用于分析安全协议和检查任何攻击的可能性会发生在协议投入使用。这方面的一个例子是飞天螳螂的工具支持对这些腐.败模型具有LED的许多攻击,以前只能通过人工分析[ 22 ]发现自动检测协议的评价。

4.2.1 飞天螳螂的工具和论文描述

任何协议应进行分析,以查看是否有任何可能的攻击,可以发现它是多么的安全。自动分析的最新方法,用于安全协议分析和它比人工更高效。所需的时间写协议的描述取决于其语言学习。所有可能的攻击将被用来测试工具。自动分析进行研究。各种工具用于分析安全协议和检查任何攻击的可能性会发生在协议投入使用。这方面的一个例子是飞天螳螂的工具支持对这些腐.败模型具有LED的许多攻击,以前只能通过人工分析[ 22 ]发现自动检测协议的评价。

飞天螳螂是一个最有效的分析工具与其他工具相比。结果发现,这个工具可以发现攻击比别人更有效,它也可以与无限数量的会话验证协议。它的运行时间也比别人少。有许多协议已通过该等工具分析了IKEv2协议IKEv1,西装,ISO / IEC 9798系列认证协议和MQV协议族的飞天螳螂的工具以协议描述作为输入,并输出报告陈述请求是否是真或假,无论任何攻击被发现或没有,和任选地,从XML描述跟踪模式[ 25 ]跟踪模式的graphvizlibrary或表示点可视化图形描述语言。此外,还有一组Python绑定的飞天螳螂的命令行工具,以脚本飞天螳螂实验提供了一个方便的方法。图5显示了这个工具厂。

安全协议形式化描述语言(SPDL)是一种用于飞天螳螂写协议[ 26 ]语言。这种语言是足够的表现力,以一种抽象的方式捕捉最相关的安全协议。它允许我们发展高层次的推理方法和工具,可以适用于一大类protocols.spdl用于创建现有的协议,使用对称和非对称加密的定义。它包括三个范围;全球范围(最大范围),协议范围(小于全球)和作用范围(最小的一个)。此外,它包括需要执行作用的初步知识(事件,每个代理的角色includessequence如发送或接收消息),声明函数,全局常量和变量。

4.2.2 该增强蜻蜓协议分析结果

在本部分,增强蜻蜓协议的SPDL表示将详细解释。之后,从这个分析的结果进行讨论。增强的蜻蜓SPDL代码显示在图6。首先,一个全球性的哈希函数H1和H2被定义(外部协议定义)使它可以用在所有卷访问协议。同时,多功能的乘法,加法,

定义全局指数指数和逆逆。函数是一种特殊类型,定义了一个函数,可以把一个变量列表。默认情况下,它的行为像一个哈希函数:所谓H1(x),H1是类型的函数,它是不可能得到X的这些功能在几个抽象的方式定义的,它不支持任何真正的方程。

其次,协议描述开始,以角色名作为参数的关键词协议。有三卷,即;密钥生成中心(角色KGC),引发剂(作用)及答辩(角色

B):

?密钥生成中心KGC的作用[ 27 ]:用在这里通过共享密钥密码P和N的角色A和B的产生方式,它是用来产生这些共享密码,并不需要一个地方来的工具,因为该工具取决于结构的协议只。共享密钥密码P和N被确定为常数及其范围内的协议,因为他们应该用在所有

角色。

?引发作用:

?这个角色代表的通信开始计算共享密钥。随机选择

Ra值,这是在协议结构的第一步(见图2)由爱丽丝(引发剂),已

用新鲜的宣言是用该得到的随机值澄清。目前是一个标准的

数据类型,通常用在飞天螳螂的工具。

?SA的计算(标量值),E(元素值),和A1(哈希值)通过使用预定义的发生

功能,然后SA和A1将被发送到的作用B.

注:标签:将需要对类似的事件发生在一个协议规范。

此外,他们是用来连接每个发送事件的接收一个[ 28 ]。

? 在角色一个接收到的事件,B的哈希值和标量值某人将被保存在一张票的变量,它可以通过任何术语取代。角色将验证这些值是从角色B或不使用匹配功能。火柴[ 29 ]确保新变量赋值相当于旧的定义和它返回true或false。如果返回值是真的然后下一步计算,否则作用会得出这样的结论:这个值是不诚实的经纪人,并关闭会话。

? 密钥的计算需要保密,所以一个类型使用秘密索赔。在索赔事件的主要思想是局部性[ 28 ] [ 29 ]:这一项不在对手的知识,或有一定的作用在运行。保密意味着如果代理与非代理通信术语应该妥协,在协议的每一丝秘密。表示一定保密信息不透露给对手,尽管这个数据是在不可信的网络连通。在这里,索赔事件已用于维持会话的关键秘密是众所周知的作用只。该工具运行时,它试图找到相应的攻击各有说法。

?答辩角色B:

?生成随机值Rb新鲜宣言。

?计算标量某人,元和散列值并将其发送到角色A B1

?验证收到的散列值的作用并利用匹配函数。

如果匹配的输出是正确的,那么B将计算出会话密钥和索赔与秘密型。该协议的SPDL插入飞天螳螂的工具以查看是否有任何攻击可能发生或是否有在该协议的任何结构的薄弱点。这个分析的结果提出没有发现攻击。所有的角色都进行了验证,这意味着没有模拟可以连接和协议结构特征发生了。这意味着交换数据的方式是完全安全的。这一结果打印在图7和图8。

5 讨论

这项研究结果显示,增强了蜻蜓的协议是安全的离线字典攻击和它的批准率由于其执行速度。在这一部分中,离线攻击将发展为仿真项目中分析时间为攻击者执行他/她的搜索两个共享密码的要求。然后,对增强蜻蜓协议的效率和原/比较修补蜻蜓协议介绍。

5.1 离线攻击仿真

攻击类已应用到以前的模拟项目。这类作品通过测量被检查所有可能的密码的时候,字典大小的变化从100,1000到100000个单词。每个实验的攻击类和平均值发现搜索时间进行了5次了。因此,在字典的大小增加在增强协议的搜索平均时间线性增加。离线搜索的平均时间当字典长度是10000超过1.5天,并与

原蜻蜓协议[ 12 ]离线搜索算法平均花费25秒找到正确的密码字典长度相同。这是因为增强协议的元变量计算两密码指数之间的关系。因此,攻击者将不得不寻找两个而不是一个词。作为一个比较之间的时间,是寻找一个密码和搜索两个密码所需的时间要求,本实验发现时间增加

指数。这种攻击对修补的蜻蜓协议搜索需要几天才能成功。然而,这里的执行时间将会对密钥交换技术效率的影响。表3显示了一个线性关系字典大小和时间尝试所有的密码。

5.2 蜻蜓,蜻蜓之间增强的修补方案的比较

增强的蜻蜓协议是补丁的蜻蜓协议非常相似,除了两个小的变化。首先,修补协议仅使用一个共享的密码和公钥,而增强的协议采用两共享密码。其次,发起人与被告之间的轮在增强协议只有两轮,而这是在修补协议四轮。然而,补丁的蜻蜓涉及一些计算成本,因为它是使用一个公共密钥验证造成大的位操作由于其大尺寸。这可以减少协议的效率,使它比其竞争对手[ 12 ]缺乏吸引力。否则,在增强蜻蜓的协议,该协议的执行将花更少的时间。为了测量采用模拟项目来计算使用字典大小的10000加上所需的时间密钥生成中心所需时间的增强蜻蜓协议的执行时间引发剂方在执行所需的协议计算。每个参与者的补丁和增强蜻蜓协议已经被放置在表4的成本,并根据这些时间的测量我们发现,使用两个共享密码的效率比使用公共密钥。

本研究的局限性在于,这些结果是基于正常机速与64位Windows 8.1 Pro操作系统和一个2.38 GHz的实时攻击不是这样速度的处理器。此外,攻击者可能会显著缩短穷举搜索时间分布的计算在几个高性能的机器。

6结论

在这项研究中我们证明了蜻蜓协议可以在增强,比其他的公共密钥验证,使其安全的离线字典攻击。提出的解决方案,已被引入到原蜻蜓协议依赖于两个共享秘密的密码,P和N使用这种解决方案,通过这些密码和两执行认证过程呈指数关系的使用轮只而不是四,这正是影响其效率。公共密钥验证的使用,这是在修补协议的提出,是造成其执行效率较低,使得计算成本。然而,在开发的仿真项目进行增强的蜻蜓协议的执行时间和离线字典攻击的时间。由于这种模拟,所需的时间为一方当事人执行增强的协议是19毫秒,而64毫秒在修补协议。分别的时间,进行离线字典攻击是非常接近的时间为字典大小10000攻击补丁的协议,这意味着增强协议的对离线字典攻击性证明。增强的协议已经用飞天螳螂分析工具分析发现它是安全的,没有任何结构上的失败。我们可以说,增强协议的可执行的蜻蜓在很短的时间,而离线字典攻击是一种攻击者耗时的搜索,它需要几天的时间来完成它。

那段岁月,无论从何种角度读你,你都完美无缺,

基于Android与多媒体的英文学习APP的设计

相关文章:

你感兴趣的文章:

标签云: