201013453 九、發明說明: 【發明所屬之技術領域】 m 本發明涉及一種手持行動電子裝置及在該裝置中進行 檔案加密的方法。 【先前技術】 曰刖六^ 利阿·丨土的丁付W勒,要于裝置應用越來 ❹ 越廣泛,這類電子裝置為通訊、娛樂以及資料交換提供 極大便利。主要的手持行動電子裝置包括手機、 (personal digital assistant ’ 個人數位助理)、掌上 及數碼相冑。 戲機 隨著手持行動電子裝置的不斷應用,利用手持行 子裝置儲存㈣越來越普遍,例如,料發送的資$ =圖片及視頻資料等。為確保資訊安全,對儲存的=201013453 IX. Description of the invention: [Technical field to which the invention pertains] m The present invention relates to a handheld mobile electronic device and a method for performing file encryption in the device. [Prior Art] 丁 ^ ^ 利 利 利 利 利 利 利 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , The main handheld mobile devices include cell phones, (personal digital assistants), handheld and digital cameras. With the continuous application of handheld mobile electronic devices, it is becoming more and more common to use handheld mobile device storage (4), for example, to send money to $=pictures and video materials. To ensure information security, on the stored =
極大的避免用戶資料外泄,保護用戶隱I 在該上内容,有必要提供—種手持行動電子裝置在 置ϊ财Ιί行檔案加密的方法,其可對手持行動電子骏 置中料的檔案進行加密,確保用戶資訊安全。骏 括:設置模Γ仃動電子裝置’所述的手持行動電子襄置包 叹置模組,用於設置檔案 匕 竭為數位密碼;讀取㈣Β瑪’所歧置的密 -,並以十個位元组 搜索模組,用㈣找卜仃’使母謂應-個數位密石馬; 置;加密额,、=在H密碼在每行位元組碼所Μ 、 行位元組碼對應的數位密瑪的 5 201013453 位置插入隨機產生的位元組碼,從而對每行進行加密;生 •成模組,用於將經過加密的位元組碼組合在一起,生成一 . 個加密的檔案。 種在手持行動電子裝置中進行檔案加密的方法,該 方法包括如下步驟:設置檔案的加密密碼,所述設置的密 碼為數位密碼;讀取組成該檔案的位元組碼,旅以十個位 元組碼為一行,使每行對應—個數位密碼;查找出每個密 Φ碼在每行位元組碼所在位置;在每一行位元組碼對應的數 位密碼的位置插入隨機產生的位元組碼,從而對每行進行 加密;將經過加密的位元組碼組合在一起,生成一個加密 的檔案。 相較於習知技術,所述的手持行動電子裝置及在該裝 置中檔案加密的方法其可對手持行動電子裝置中儲存的檔 案進行加密,確保用戶的資訊安全。 【實施方式】 ❹ 如圖1所示,為本發明手持行動電子裝置的架構圖。所 述的手持行動電子裝置1是指手機、個人數位助理(Pers〇nal Digital Assistant,PDA)等装置。所述的手持行動電子裝 置1包括設置模組20、讀取模組21、搜索模組22、加密模組 23及生成模組24。 所述的手持行動電子裝置i包括記憶體3。所述的記憶 體3用於儲存各類資料,如,檔案、圖片及視頻資料等。所 述記憶體3可以是該手持行動電子裝置J本身的記憶體,還 可以是外部儲存卡’如SM卡(Smart Media Card ,智慧媒 201013453 體卡)、SD卡(Secure Digital Card,安全數位卡)、CF卡 (Compact Flash Card,標準快閃記憶體卡)、MMC卡(Multi Media Card,多媒體卡)、MS卡(Memory Stick,記憶棒)、 XD卡(Extreme Digital Card,極限數字卡)、TF卡(TransGreatly avoiding the leakage of user data and protecting the user's content. It is necessary to provide a method for encrypting the file of the handheld mobile electronic device, which can be used for the file of the mobile electronic device. Encryption ensures user information security. Junqi: Set the mobile electronic device's handheld mobile electronic device package sigh module, used to set the file exhausted to a digital password; read (four) Karma's disambiguated secret - and ten A byte search module, using (4) to find the divination 'make the mother should be - a number of secret stone horse; set; encryption amount,, = in the H password in each line of the byte code, line byte code The corresponding digits of the MM 5 201013453 are inserted into the randomly generated byte code to encrypt each line; the raw module is used to combine the encrypted byte codes to generate an encryption. Archives. A method for performing file encryption in a handheld mobile electronic device, the method comprising the steps of: setting an encrypted password of the file, the set password is a digital password; reading a byte code constituting the file, and traveling in ten positions The tuple code is one line, so that each line corresponds to a digit password; find each fixed Φ code at the position of each line of the byte code; insert a randomly generated bit at the position of the digit password corresponding to each line of the byte code The tuple code is used to encrypt each line; the encrypted byte codes are combined to generate an encrypted file. Compared with the prior art, the handheld mobile electronic device and the file encryption method in the device can encrypt the file stored in the handheld mobile electronic device to ensure the user's information security. [Embodiment] FIG. 1 is a structural diagram of a handheld mobile electronic device of the present invention. The handheld mobile electronic device 1 refers to a device such as a mobile phone or a personal digital assistant (PDA). The handheld mobile electronic device 1 includes a setting module 20, a reading module 21, a search module 22, an encryption module 23, and a generating module 24. The handheld mobile electronic device i comprises a memory 3. The memory 3 is used to store various types of materials, such as files, pictures, and video materials. The memory 3 may be the memory of the handheld mobile device J itself, or may be an external storage card such as an SM card (Smart Media Card, Smart Media Card, 201013453 card), an SD card (Secure Digital Card, a secure digital card). ), CF card (Compact Flash Card), MMC card (Multi Media Card), MS card (Memory Stick), XD card (Extreme Digital Card), TF card (Trans
Flash Card )等。 所述的設置模組20,用於設置檔案的加密密碼,所述 設置的密碼為數位密碼。所述的檔案可以是檔案(如,w〇rdFlash Card) and so on. The setting module 20 is configured to set an encrypted password of the file, and the set password is a digital password. The file can be an archive (eg, w〇rd
資料)、圖片及視頻資料。所述設置的密碼都是數位密碼, 且最長不超過16個數字。 所述的讀取模組21,用於讀取組成該檔案的位元組 碼,並以十個位元組碼為一行,使每行對應一個數位密碼。 具體而言,在電腦内部儲存的檔案都是由位元組(Byk) 組合而成。如圖4所示,為一個檔案的位元組碼,從圖中可 以看出,讀取模組21在讀取該檔案的位元組碼時,以十個 為—行’且每—行每—個位元組瑪都有-個位置 、禚號,標號從數字〇到9 ’假設用戶設置的密碼是6 $ 〇 28, ^仃,對應-個數位密竭,例如,第—行的位元組 數位密竭為6,第二行的位元組碼對應的數位密瑪為5,、第 三行的位元組碼對應數位密為〇,第四 , 數位密騎的對縫馬Γ 行的位元組碼對應數位料為8,之後每六行 圈’依次填入對應的數位密碼,即第七行的位 6’依照此迴圈,—直到位元組碼的結尾。㈣也為 所述的搜余模組22,用於查找出每個密瑪在對應行的 201013453 所在位置。具體而言,如圖4所示,以第一行位元 該行對應的數位密碼為6,則該數位密碼所在位置是 6的位置’若以第三行為例’該行對應的數位密〇 7 該數位密碼所在位置是標號為0的位置。 、,則 ❹ ❹ 所述的加密模組23,用於在每一行位元組媽 位密碼的位置插入兩個隨機產生的位元董 進行加密。所述插入的位元組瑪可以兩個位元組 兩個以上的位站,插人的位元組越多加密的程度越/ 在本較佳實施例中’插入的位元組數為兩個。所ς插二 位元組碼由隨機函數(Random)產生。具體而 : 中的第-餘驗碼騎,畴制雜絲 位置為6,則在該行的第⑽位置之後插人兩純元^在 ,圖5所示,對圖4中的第一行位元組碼進行加密的過=, 從圖中可以看出’插人兩個隨機產生的位元組碼之 中兩個下劃_位元組碼),崎包含職位元㈣。(對圖圖 4立中每-行的位元組碼進行加密之後,圖吟加密之後的示 思圖。 所述的生成模組24,用於將經過加密的位元組碼組合 在一起’生成一個加密的槽案。加密之後的檔案,需要輸 入密碼才能讀取。 如圖2所示’為本發明在手持行動電子I置中進行槽案 加密方法較佳實施例的流程圖。首先,步驟si〇,設置模 组20設置權案的加密㈣’所述設置的密崎為數位密碼。 所述的檔案可以是檔案(如,偷讀料)、圖片及視頻資 201013453 料。所述設置的密碼都是數位密喝,且最長不超㈣個數 字。 步驟sn,讀取模組21讀取組成該播案的位元組碼,並 以十個位兀組嫣為—行,使每行對應一個數位密碼。具體 =,=内部儲存的槽案都是由位元組(_組合 2成^圖4所示,為一個檔案的位元組碼,從圖中可以看 出,讀取模組2!在讀取該槽案的位元組竭時 組碼為-行,且每一行每一個位 = 灯都對應-個數位密碼,例如 位密瑪為6,第二行的位元組瑪對應的數^ 對f 行,元組嗎對應數位密碼為0,第四_ 、、^5,第^ 二碼為2 ’第五行的位元組碼對應數位密碍為Π巧" 、立7L組喝對應數位密瑪為8,之後每六作為、,六打 依次填入對應的數 1乍為一個迴圈, ❹照此迴圈,—直的位元組碍也為6,依 數位==,22查找出每-行位〜應的 一行值元組丨位置。具體而"’如圖4所示,以第 :在位置是標號為6的位置,若以第三 、數:密竭為〇,則該數位密碼所在位置是禆:議行對應 —步驟叱,加密模組23在每一行位為0的位置。 雄、碼的位晉批 、、且竭對應的數位 行加密。所隨機產生的位元組瑪,從而對每行進 攻插入的位元組碼可以是兩個位元級,也可以 9 201013453 是兩個以上的位元組,插入的位元組越多加密的程度越 ‘ 高’在本較佳實施例中,插入的位元組數為兩個。所述插 入的位元組碼由隨機函數(Random)產生。具體而言,以 圖4中的第一行位元組碼為例,該行對應的數位密碼為6, 所在位置為6’則在該行的第六個位置之後插入兩個位元組 碼,如圖5所示,對圖4中的第一行位元組碼進行加密的過 程,從圖中可以看出,插入兩個隨機產生的位元組瑪之後 蠡(圖5中兩個下劃線的位元組碼),該行包含12個位元組 碼。對圖4中每一行的位元組碼進行加密之後,圖6為加密 之後的示意圖。 步驟S14,生成模組24將經過加密的位元組碼組合在 一起,生成一個加密的檔案。加密之後的檔案,需要輸入 密碼才能讀取 如圖3所示,為本發明在手持行動電子裝置中進行檔案 解雄、方法較佳實施例的流程圖。 ❹ 首先,步驟S2〇,以十二個位元組碼為一行讀取加密 檔案的位元組碼。所述的檔案可以是檔案(如,Word資 料)、圖片及視頻資料。 B步驟S21,輸入用戶設置的密碼。所述設置的密碼都 疋數位密碼,且最長不超過16個數字。 =步驟S22,查找出每一行位元組碼對應的數位密碼在 該行的所在位置。具體而言,如圖6所示,以第一行位元組 碼為例,5亥行對應的數位密碼為6,則該數位密碼所在位置 疋‘號為6的位置,若以第三行為例,該行對應的數位密螞 201013453 為ο,則該數位密碼所在位置是標號為〇的位置。 步驟S23 ’去除每—行中數位密碼所在位置後面的兩 個位元組碼,則對該槽案進行了解密。具體而言,以圖6 中第一行位元組碼為例,該行對應的數位密碼為6,在位置 6的後面取出位置7和8對應的兩個位元組碼,_行位元組 碼還原成之前的位元㈣,完成㈣動作。 步驟S24,將經過解密的位元組碼組合在—起 為該檔案的原始位元組碼。若用戶輸入的密碼錯誤,則益 法正確的解密’解密出來的槽案也不是原始槽案。 最後所應說明的是,以上實施例僅用以說明本發明的 技術方案而非限制’儘管參照以上較佳實施例對本發明進 :了詳細說明,本領域的普通技術人員應當理解,可以對 發明的技術方案進行修改或等同替換,而不脫離本發明 技術方案的精神和範圍。 【圖式簡單說明】 m 圖1為本發明手持行動電子裝置的架構圖。 圖2為本發明在手持行動電子I置中進㈣案加密方 法較佳實施例的流程圖。 圖3為本發明在手持行動電子裝置中進行檀案解密方 /去較佳實施例的流程圖。 圖4為本發明較佳實施例檔案加密前位元組碼的示意 圖。 圖5為本發明在手持行動電子農置中對槽案進行 過程的示意圖。 11 201013453 圖6為本發明檔案加密之後位元組碼的示意圖。 【主要元件符號說明】 手持行動電子裝置 1 記憶體 3 設置模組 20 讀取模組 21 搜索模組 22 加密模組 23 生成模組 24 12Information), pictures and video materials. The set passwords are all digit passwords, and the maximum length is no more than 16 digits. The reading module 21 is configured to read the byte code constituting the file, and use ten byte codes as one line, so that each line corresponds to one digit password. Specifically, files stored inside the computer are composed of a combination of bytes (Byk). As shown in FIG. 4, it is a byte code of a file. As can be seen from the figure, when the reading module 21 reads the byte code of the file, ten lines are - and each line Each byte has a position, an apostrophe, and the number from the number 9 to 9 'assuming that the password set by the user is 6 $ 〇28, ^仃, corresponding to a number of digits exhausted, for example, the first line The digits of the byte are exhausted to 6, the digit of the byte of the second row is 5, and the digit of the byte of the third row is 〇, and the fourth is the number of stitches of the horse. The byte code corresponding to the byte is 8 and then every 6 lines is filled with the corresponding digit password, that is, the bit 6 of the seventh line is in accordance with this loop, until the end of the byte code. (4) Also for the search module 22, it is used to find the location of each of the corresponding lines of 201013453. Specifically, as shown in FIG. 4, the digit password corresponding to the row in the first row of bits is 6, and the location of the digit password is the location of 6 'if the third behavior example' corresponds to the digit of the row. 7 The location of the digit password is the location marked 0. The cryptographic module 23 is configured to insert two randomly generated bit elements at the position of each row of the byte of the byte to encrypt. The inserted byte group may have two or more bit stations of two bytes, and the more the bit bytes inserted, the more the degree of encryption / the number of bytes inserted in the preferred embodiment is two One. The interpolated binary code is generated by a random function (Random). Specifically: in the first-after-test code riding, the domain-made moire position is 6, then insert two pure elements after the (10) position of the line, as shown in Figure 5, for the first line in Figure 4. The byte code is encrypted =, from the figure it can be seen that 'insert two randomly generated byte codes among the two randomly generated octet codes. Saki contains the position element (4). (After the encryption of the byte code for each line in Figure 4, the image is decoded after the image is encrypted. The generation module 24 is used to combine the encrypted byte codes together' An encrypted slot file is generated. The encrypted file needs to be input with a password to be read. As shown in FIG. 2, a flow chart of a preferred embodiment of the method for encrypting a slot in a handheld mobile electronic device is shown. Step si〇, the setting module 20 sets the encryption of the rights (four) 'The set of Misaki is a digital password. The file may be a file (eg, sneak), picture and video resources 201013453. The setting The passwords are all digitally secret, and the longest is not more than (four) digits. Step sn, the reading module 21 reads the byte code that constitutes the broadcast, and uses ten digits as the line, so that each The row corresponds to a digit password. Specifically =, = the internal storage slot is composed of bytes (_ combination 2 into ^ Figure 4, is a byte of the file, as can be seen from the figure, read Module 2! When reading the byte of the slot, the group code is -row, and each row is The digit = lamp corresponds to a digit password, for example, the bit mil is 6, the second row of the byte corresponds to the number ^ to f rows, the tuple corresponds to the digit password is 0, the fourth _, ^ ^ 5 , the second code is 2 'the fifth line of the byte code corresponding to the number of bits is Π巧 ", the 7L group drink the corresponding number of 密马 is 8, then every six, six, then fill in the corresponding number 1乍 is a loop, according to this loop, the straight byte is also 6, according to the digit ==, 22 finds the position of each row-valued tuple 应 position. Specifically and " 'As shown in Figure 4, the first: in the position is the number 6 position, if the third, the number: exhausted as the 〇, then the location of the digital password is 禆: the line of correspondence - step 叱, encryption module 23 is in the position of 0 in each row. The digits of the digits, the digits of the digits, and the corresponding digits are encrypted. The randomly generated byte groups, so that the byte code inserted for each line of attack can be two. One bit level, also 9 201013453 is more than two bytes, the more the inserted bytes, the more "high" the encryption is in the preferred embodiment, the insertion The number of byte groups is two. The inserted byte code is generated by a random function (Random). Specifically, taking the first row of the byte code in FIG. 4 as an example, the corresponding digital password of the row is 6, where the position is 6', then insert two byte codes after the sixth position of the line, as shown in Figure 5, the process of encrypting the first line of the byte code in Figure 4, from the figure It can be seen that after inserting two randomly generated byte groups 蠡 (two underlined byte codes in Figure 5), the line contains 12 byte codes. For each row in Figure 4 After the group code is encrypted, Figure 6 is a schematic diagram after encryption. In step S14, the generation module 24 combines the encrypted byte codes to generate an encrypted file. The encrypted file needs to be input with a password to be read. As shown in FIG. 3, it is a flowchart of a preferred embodiment of the method for performing file archiving in a handheld mobile electronic device. ❹ First, in step S2, the byte code of the encrypted file is read in a row of twelve byte codes. The file may be an archive (e.g., Word material), a picture, and a video material. In step B21, the password set by the user is input. The set passwords are all numeric passwords and can be up to 16 digits in length. In step S22, it is found that the digit password corresponding to each row of the byte code is at the position of the line. Specifically, as shown in FIG. 6 , taking the first row of the byte code as an example, if the digital password corresponding to the 5th row is 6, the position of the digital password is 疋 'the position of 6, if the third behavior For example, if the corresponding digit of the line is 201013453, the location of the digit password is the position marked 〇. Step S23' removes the two byte codes following the position of the digit password in each line, and decrypts the slot. Specifically, taking the first row of the byte code in FIG. 6 as an example, the corresponding digit password of the row is 6, and after the location 6, the two byte codes corresponding to the positions 7 and 8 are taken out, and the _ row bit is taken. The group code is restored to the previous bit (four), and the (four) action is completed. In step S24, the decrypted byte code is combined to be the original byte code of the file. If the password entered by the user is incorrect, then the correct decryption of the decrypted 'decrypted slot case is not the original slot case. It should be understood that the above embodiments are merely illustrative of the technical solutions of the present invention and are not intended to be construed as the invention. The technical solutions are modified or equivalently substituted without departing from the spirit and scope of the technical solutions of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of a handheld mobile electronic device of the present invention. 2 is a flow chart of a preferred embodiment of the encryption method of the hand-held mobile electronic I in the hand-held mobile electronic I. 3 is a flow chart of a preferred embodiment of a method for decrypting a Tan file in a handheld mobile electronic device according to the present invention. 4 is a schematic diagram of a byte of a file before encryption according to a preferred embodiment of the present invention. Fig. 5 is a schematic view showing the process of the slot case in the hand-held mobile electronic farm. 11 201013453 FIG. 6 is a schematic diagram of a byte code after file encryption according to the present invention. [Main component symbol description] Handheld mobile electronic device 1 Memory 3 Setting module 20 Reading module 21 Search module 22 Encryption module 23 Generation module 24 12