天堂国产午夜亚洲专区-少妇人妻综合久久蜜臀-国产成人户外露出视频在线-国产91传媒一区二区三区

基于操作碼的Python程序防逆轉(zhuǎn)算法研究與實現(xiàn)

發(fā)布時間:2018-04-05 03:04

  本文選題:Python 切入點:字節(jié)碼文件 出處:《中國科學(xué)技術(shù)大學(xué)》2017年碩士論文


【摘要】:Python編程語言自20世紀(jì)90年誕生至今,得益于其簡單易學(xué)、語法簡潔清晰、可擴展性強、支持面向?qū)ο蟮戎T多優(yōu)點,已被廣泛的應(yīng)用于系統(tǒng)管理任務(wù)和Web編程等諸多領(lǐng)域。但使用Python編程語言編寫的源碼文件(.py)編譯生成的字節(jié)碼文件(Bytecode file,.pyc)很容易被逆向工具反編譯,這不僅會侵害開發(fā)人員的知識產(chǎn)權(quán)和經(jīng)濟利益,而且具有嚴(yán)重的安全隱患。于此同時現(xiàn)有的代碼混淆技術(shù)、文件加密技術(shù)、本地編譯技術(shù)、數(shù)字水印技術(shù)等防逆轉(zhuǎn)方法存在安全性不足、容易造成字節(jié)碼文件的執(zhí)行效率下降、應(yīng)用體積增加等問題。為此本文圍繞基于操作碼替換與合并的Python字節(jié)碼文件防逆轉(zhuǎn)策略展開研究工作,本文的主要的研究內(nèi)容和成果包括以下三個方面:(1)通過對Python運行框架和Python字節(jié)碼文件編譯、解釋執(zhí)行機制的分析,根據(jù)Python虛擬機對字節(jié)碼文件中的操作碼逐一進行解釋執(zhí)行的特性,將Python字節(jié)碼文件的核心內(nèi)容co_code域進行簡化抽象,建立字節(jié)碼文件的操作碼序列模型與基本塊模型。(2)針對現(xiàn)有的代碼混淆技術(shù)和數(shù)字水印技術(shù)安全性不足的問題,本文以字節(jié)碼文件中的操作碼序列為基礎(chǔ),結(jié)合單表替換密碼,設(shè)計出了一種適用于Python字節(jié)碼文件的操作碼的操作碼替換策略。該策略通過操作碼替換來改變操作碼序列中操作碼的值來達到改變操作碼序列內(nèi)容和防逆轉(zhuǎn)的目的。最后對操作碼替換策略在Python2.7.9中予以實現(xiàn),并根據(jù)單表替換密碼的特性,利用操作碼的統(tǒng)計學(xué)規(guī)律,評估操作碼替換策略的安全性。(3)針對文件加密技術(shù)易對字節(jié)碼文件的執(zhí)行效率造成影響和本地編譯技術(shù)造成目標(biāo)程序體積增加的問題,本文設(shè)計出一種操作碼合并策略。該策略以字節(jié)碼文件中的操作碼序列的基本塊為基礎(chǔ),利用窺孔優(yōu)化技術(shù)將處于同一個基本塊中連續(xù)出現(xiàn)的多個操作碼進行合并,并使用新操作碼來代替原來操作碼序列中連續(xù)出現(xiàn)的多個操作碼。通過操作碼合并大大縮短了操作碼序列的長度,改變了操作碼序列的結(jié)構(gòu)和內(nèi)容,最終達到防逆轉(zhuǎn)的目的。最后對操作碼合并策略在Python 2.7.9中予以實現(xiàn),并對操作碼合并策略產(chǎn)生的字節(jié)碼文件的安全性、執(zhí)行效率、以及文件大小進行評估與實驗。
[Abstract]:Python programming language has been widely used in many fields, such as system management task and Web programming, because of its simplicity, clear syntax, strong expansibility and object-oriented support.However, the bytecode file compiled by Python programming language is easy to be decompiled by reverse tools, which not only infringes the intellectual property rights and economic benefits of developers, but also has a serious security hazard.At the same time, the existing anti-reverse methods, such as code confusion, file encryption, local compilation, digital watermarking and so on, are not secure enough, which can easily lead to the decrease of the execution efficiency of bytecode files and the increase of application volume.Therefore, this paper focuses on the anti-reversal strategy of Python bytecode files based on opcode replacement and merging. The main research contents and results of this paper include the following three aspects: 1) compiling the Python running framework and Python bytecode files.The analysis of execution mechanism is explained. According to the characteristic of Python virtual machine to interpret and execute the opcodes in bytecode file one by one, the core content of Python bytecode file is simplified and abstracted by co_code domain.To solve the problem of insufficient security of existing code obfuscation technology and digital watermarking technology, this paper bases on the operation code sequence in bytecode file and replaces the cipher with single table, which is based on the operation code sequence model of bytecode file and the basic block model.An opcode replacement strategy for Python bytecode files is designed.This strategy can change the content of the opcode sequence and prevent the reverse by changing the value of the opcode in the opcode sequence by replacing the opcode.Finally, the opcode replacement strategy is implemented in Python2.7.9, and according to the characteristics of single-table substitution cipher, the statistical rule of opcode is used.To evaluate the security of opcode replacement policy, this paper designs an opcode merging strategy to solve the problem that file encryption technology can easily affect the efficiency of bytecode file execution and the local compilation technology causes the volume of target program to increase.Based on the basic blocks of the sequence of operands in the bytecode file, the strategy combines multiple opcodes which appear continuously in the same basic block by using peephole optimization technique.New opcodes are used to replace multiple operands which appear continuously in the sequence of original opcodes.The length of the opcode sequence is greatly shortened and the structure and content of the opcode sequence are changed by the combination of opcodes.Finally, the opcode merging policy is implemented in Python 2.7.9, and the security, execution efficiency and file size of bytecode files generated by the opcode merging policy are evaluated and tested.
【學(xué)位授予單位】:中國科學(xué)技術(shù)大學(xué)
【學(xué)位級別】:碩士
【學(xué)位授予年份】:2017
【分類號】:TP312

【參考文獻】

相關(guān)期刊論文 前8條

1 蘇慶;吳偉民;李忠良;李景j;陳為德;;混沌不透明謂詞在代碼混淆中的研究與應(yīng)用[J];計算機科學(xué);2013年06期

2 蔣華;劉勇;王鑫;;基于控制流的代碼混淆技術(shù)研究[J];計算機應(yīng)用研究;2013年03期

3 楊樂;周強強;薛錦云;;基于垃圾代碼的控制流混淆算法[J];計算機工程;2011年12期

4 徐海銀;雷植洲;李丹;;代碼混淆技術(shù)研究[J];計算機與數(shù)字工程;2007年10期

5 鮑福良;彭俊艷;方志剛;;Java類文件保護方法綜述[J];計算機系統(tǒng)應(yīng)用;2007年06期

6 陳晗,趙軼群,繆亞波;Java字節(jié)碼的水印嵌入[J];計算機應(yīng)用;2003年09期

7 陳明奇,鈕心忻,楊義先;數(shù)字水印的研究進展和應(yīng)用[J];通信學(xué)報;2001年05期

8 孫圣和,陸哲明;數(shù)字水印處理技術(shù)[J];電子學(xué)報;2000年08期



本文編號:1712891

資料下載
論文發(fā)表

本文鏈接:http://sikaile.net/falvlunwen/zhishichanquanfa/1712891.html


Copyright(c)文論論文網(wǎng)All Rights Reserved | 網(wǎng)站地圖 |

版權(quán)申明:資料由用戶7b574***提供,本站僅收錄摘要或目錄,作者需要刪除請E-mail郵箱bigeng88@qq.com