WO2008086731A1 - Method and system of encrypt by using chaotic cipher stream - Google Patents

Method and system of encrypt by using chaotic cipher stream Download PDF

Info

Publication number
WO2008086731A1
WO2008086731A1 PCT/CN2008/000040 CN2008000040W WO2008086731A1 WO 2008086731 A1 WO2008086731 A1 WO 2008086731A1 CN 2008000040 W CN2008000040 W CN 2008000040W WO 2008086731 A1 WO2008086731 A1 WO 2008086731A1
Authority
WO
WIPO (PCT)
Prior art keywords
chaotic
key
value
values
int
Prior art date
Application number
PCT/CN2008/000040
Other languages
French (fr)
Chinese (zh)
Inventor
Shu Tak Raymond Lee
Original Assignee
Shu Tak Raymond Lee
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shu Tak Raymond Lee filed Critical Shu Tak Raymond Lee
Publication of WO2008086731A1 publication Critical patent/WO2008086731A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/001Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/065Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3

Definitions

  • the present invention relates to data processing and, more particularly, to a method and system for applying chaotic cipher stream encryption. Background technique
  • the cryptosystem encrypts the original information and decrypts the encrypted information based on mathematical principles.
  • the present invention uses a new mathematical principle, a chaotic principle.
  • the chaotic encryption method is widely used in the field of communication. It is a set of nonlinear dynamic equations controlled by one or more parameters; therefore, the chaotic state changes according to the subtle changes of the parameters and is sensitive to the initial state.
  • the chaotic systems that people can access every day include: water flowing out of taps, angry smoke in cigarettes, rising and falling stock markets, and musical melody.
  • this method can also be implemented in asymmetric encryption.
  • the chaotic cryptosystem is
  • the technical solution adopted by the present invention to solve the problems existing in the prior art is to provide a method for applying encrypted cipher stream encryption, which includes the following steps:
  • the random number generator generates a symmetric key and stores it in a memory
  • the plaintext and the virtual key are operated to obtain a ciphertext.
  • a method for applying chaotic cipher stream decryption comprising the steps of:
  • the ciphertext and the virtual key are operated to obtain plaintext.
  • a system for chaotic cipher stream encryption comprising the following means:
  • a memory for storing a symmetric key generated by the random number generating device
  • a chaotic mapping device that generates a chaotic map of symmetric key values to generate chaotic values
  • a transforming device that rounds the chaotic values and reverses partial chaotic values
  • the ciphertext encryption device is obtained by calculating the plaintext and the virtual key.
  • a system for chaotic cryptographic stream decryption comprising the following means:
  • a chaotic mapping device that performs chaotic mapping on a symmetric key value in a memory to generate a chaotic value; a conversion device that rounds the chaotic value and reverses a partial chaotic value;
  • the ciphertext and the virtual key are operated to obtain a plaintext decryption device.
  • the encryption method of the present invention is completely dependent on the initial parameters and, therefore, is more difficult to decrypt if the illegal decryptor does not know the initial parameters. Moreover, the method and system proposed by the present invention are also applicable to any field requiring encryption.
  • FIG. 1 is a block diagram of an encryption system of the present invention
  • FIG. 2 is a block diagram of the decryption system of the present invention.
  • 3 is a flow chart of applying chaotic cipher stream encryption according to the present invention.
  • FIG. 4 is a flow chart of the application of chaotic cipher stream decryption in the present invention.
  • the encryption system of the present invention includes a memory 102, a random number generating device 101 that generates and stores a symmetric key, and chaotic mapping of the generated symmetric key values to generate a chaotic value chaotic mapping device 103.
  • the conversion device 104 that chases the chaotic value and reverses the partial chaotic value, merges the chaotic value into the key generation device 105 that constitutes the virtual key, and performs the encryption operation on the plaintext and the virtual key to obtain the ciphertext encryption.
  • Device 106 is a block diagram of an encryption system of the present invention.
  • the encryption system of the present invention includes a memory 102, a random number generating device 101 that generates and stores a symmetric key, and chaotic mapping of the generated symmetric key values to generate a chaotic value chaotic mapping device 103.
  • the conversion device 104 that chases the chaotic value and reverses the partial chaotic value, merges the chaotic value into the key generation device 105 that constitutes the virtual key, and performs the encryption operation on the plaintext and the virtual key to obtain the cipher
  • the decryption system of the present invention includes a chaotic mapping device 201 that performs chaotic mapping of symmetric key values in a memory to generate chaotic values, truncating the chaotic values, and inverting partial chaotic values.
  • the converting means 202 combines the chaotic values into a key generation means 203 which constitutes a virtual key, and operates the ciphertext and the virtual key to obtain a plaintext decryption means 204.
  • Step 300 the random number generating means 101 generates a symmetric key k, which may be of variable length. In the present embodiment, a length of 32 bytes is used, and the key k stores an ASCII value of 0 to 255. storage.
  • step 305 the symmetric key k is stored in the database 102 for decryption processing.
  • step 310 the key value k is placed in the chaotic mapping device, and after the chaotic mapping is performed multiple times, a chaotic value is generated.
  • Step 315 the chaotic value is truncated by the conversion device 104 to an integer value, for example, 0.12345 is truncated to 12345, and some chaotic values are reversed by the conversion device 104, for example, 12345 is inverted to 54321.
  • Step 320 The key generation device combines all the chaotic values into a virtual key S, for example, 12345.54321, etc. to form 1234554321.... The length of the S value varies according to different symmetric keys.
  • Step 325 the plaintext P is read into the encryption device 106.
  • the plaintext P and the virtual key S perform operations multiple times, for example, an exclusive OR operation to ensure randomness of the encrypted text, where the encrypted information C is generated.
  • the key k is a symmetric key with a certain number of bytes, and each byte includes an ASCII value of 0 to 255 (hexadecimal value 00 to FF).
  • the key is used to place a logarithmic map to produce a value for future encryption/decryption processing.
  • the chaotic value (d n ) is the resulting value of the chaotic map inserted into k n .
  • is the fractional part of ⁇ , the integer part is truncated, and then the fractional part is reversed.
  • P is plaintext, that is, information before encryption.
  • C is ciphertext, that is, encrypted information.
  • a is a parameter of the logarithmic mapping, because the branching property of the logarithmic mapping multiplies the mapping period to become chaotic, so a is usually set to be greater than 3.
  • the value of X is set to 0 to 1.
  • n represents the nth repetition within the logarithmic map, the number of repetitions is variable, and is usually set to be greater than
  • logarithmic mapping available to the core of the encryption/decryption technique of the present invention, but any other type of chaotic mapping can be used in the core portion of the cryptographic technique of the present invention.
  • the reason for using logarithmic mapping here is that this equation is simple, does not require too many computational resources, but the results are complex.
  • the processing in the present invention finds a balance between the randomness of ciphertext and the speed of encryption/decryption processing.
  • the exemplary encryption source code is as follows: '
  • File encrypt_ output new File(dirname +" ⁇ " + fhame + " ef); defileOl ⁇ new FileOutputStream(encrypt_output);
  • Defile new BufferedOutputStream(defile01 );
  • Kflle ⁇ new BufferedOutputStream(kfile01 );
  • BASE64Decoder decoder new BASE64Decoder()
  • Defile new BufferedOutputStream(defile01 );
  • Load_key[n] (byte) intKeyGen[n];
  • Nsvalue nsvalue.substring(nsvalue.lastIndexOf(.")+l);
  • Nsvalue sb.reverse().toString()
  • Map— key new byte[ct]
  • Map_key[i] (byte) (255 - map_key[i]);
  • Map—key [i] map— key [i];
  • Double lm ( (double) k / 512);
  • FIG. 4 is a flow chart of decrypting information by the document reading module of the present invention.
  • the key value is placed in the chaotic mapping device 201, and after the chaotic mapping is performed multiple times, a chaotic value is generated.
  • the chaotic value is truncated by the converting means 202 to an integer value. For example, 0.12345 is truncated to 12345, and some chaotic values are reversed by the converting means 202, for example, 12345 is inverted to 54321.
  • the key generation means 203 combines all the chaotic values into a virtual key S, for example, 12345, 54321, etc. to constitute 1234554321.... The length of the S value varies according to different symmetric keys.
  • ciphertext C is read into the memory.
  • the encrypted information C and the virtual key S perform operations multiple times, for example, XOR operations to generate original information. .
  • the exemplary decryption source code is as follows:
  • Kfile new BufferedInputStream(kfileO 1 );
  • Form_key() IIOpen the input text document and create an output text document
  • Fext fext + (char) xor_opt(i, cext[i]);
  • Defile new BufferedOutputStream(defile01 );
  • Kfile new BufferedInputStream(kfileO 1 ); II reads the key from the key file
  • BASE64Decoder decoder new BASE64Decoder()
  • Fext fext + (char) xor_opt(i, cext[i]);
  • Defile new BufferedOutputStream(defile01 ); ppO;e ioExction.rntStackTirace
  • Nsvalue nsvalue. substring(nsvalue.lastIndexOf(.")+l);
  • Nsvalue sb.reverse().toString()
  • Map— key new byte[ct]
  • Map_key[i] (byte) (255 - map— key[i]);
  • Map— key [i] map_key[i];

Abstract

A method and a system of the encrypt by using the chaotic cipher stream to encrypt, in which the method includes encrypting by operating the chaotic cipher stream generated with the clear text data, and decrypting through XOR operating between the cipher text data with the said chaotic cipher stream. The encrypting method depends completely upon the initial parameter, thus it is more difficulty to be decrypted as the person who engages illegal decrypting doesn't know the initial parameter.

Description

一种应用混沌密码流加密的方法和系统 技术领域  Method and system for applying chaotic cipher stream encryption
本发明涉及数据处理,更具体地说,涉及一种应用混沌密码流加密的方法 和系统。 背景技术  The present invention relates to data processing and, more particularly, to a method and system for applying chaotic cipher stream encryption. Background technique
密码系统是基于数学原理对原始信息加密和对加密的信息进行解密。本发 明使用新的数学原理一混沌原理。混沌加密方法广泛地应用于通信领域, 是一 套非线性的动态等式, 由一个或多个参数控制; 因此混沌状态是根据参数的细 微变化而变化的, 并且对初始状态敏感。 人们日常能接触到的混沌系统包括: 自来水龙头中流出的水, 香烟中生气的烟雾, 股票市场的升和跌, 以及, 音乐 的旋律。  The cryptosystem encrypts the original information and decrypts the encrypted information based on mathematical principles. The present invention uses a new mathematical principle, a chaotic principle. The chaotic encryption method is widely used in the field of communication. It is a set of nonlinear dynamic equations controlled by one or more parameters; therefore, the chaotic state changes according to the subtle changes of the parameters and is sensitive to the initial state. The chaotic systems that people can access every day include: water flowing out of taps, angry smoke in cigarettes, rising and falling stock markets, and musical melody.
将来, 这个方法也可以实现在非对称加密中。 实际上, 混沌密码系统是 In the future, this method can also be implemented in asymmetric encryption. In fact, the chaotic cryptosystem is
IATOPIA密码系统的主要信息之一。 通过智能代理技术(IAT) 的支持, 更深 层的 IATOPIA密码系统的解释是版权保护技术 (CPT)。 发明内容 One of the main information of the IATOPIA cryptosystem. With the support of Intelligent Agent Technology (IAT), the deeper interpretation of the IATOPIA cryptosystem is copyright protection technology (CPT). Summary of the invention
本发明解决现有技术中存在的问题所采用的技术方案是:提供一种应用混 沌密码流加密的方法, 包括以下步骤:  The technical solution adopted by the present invention to solve the problems existing in the prior art is to provide a method for applying encrypted cipher stream encryption, which includes the following steps:
51. 随机数字产生器产生对称密钥, 并储存于存储器;  51. The random number generator generates a symmetric key and stores it in a memory;
52. 将产生的对称密钥值混沌映射, 以产生混沌值;  52. Chaotic mapping of generated symmetric key values to generate chaotic values;
53. 将所述混沌值舍位, 并将部分混沌值反向;  53. Round the chaotic value and reverse part of the chaotic value;
54. 将所述混沌值合并组成虚拟密钥;  54. Combine the chaotic values into a virtual key;
55. 明文和所述虚拟密钥进行运算得到密文。  55. The plaintext and the virtual key are operated to obtain a ciphertext.
根据本发明的另一个方面,提供一种应用混沌密码流解密的方法,包括以 下步骤:  According to another aspect of the present invention, a method for applying chaotic cipher stream decryption is provided, comprising the steps of:
1 确认本 51.将所述对称密钥值混沌映射, 以产生混沌值; 1 Confirmation 51. Chaotically mapping the symmetric key value to generate a chaotic value;
52. 将所述混沌值舍位, 并将部分混沌值反相; ' 52. Round the chaotic value and invert the partial chaotic value;
53. 将所述混沌值合并组成虚拟密钥; 53. Combine the chaotic values into a virtual key;
54. 密文和所述虚拟密钥进行运算得到明文。  54. The ciphertext and the virtual key are operated to obtain plaintext.
根据本发明的另一个方面,提供一种混沌密码流加密的系统,包括下述装 置:  According to another aspect of the present invention, a system for chaotic cipher stream encryption is provided, comprising the following means:
产生对称密钥的随机数字生成装置;  a random number generating device that generates a symmetric key;
用于存储所述随机数字生成装置产生的对称密钥的存储器;  a memory for storing a symmetric key generated by the random number generating device;
将产生的对称密钥值混沌映射, 以产生混沌值的混沌映射装置; 将所述混沌值舍位, 并将部分混沌值反向的转换装置;  a chaotic mapping device that generates a chaotic map of symmetric key values to generate chaotic values; a transforming device that rounds the chaotic values and reverses partial chaotic values;
将所述混沌值合并组成虚拟密钥的密钥生成装置;  Combining the chaotic values into a key generation device that constitutes a virtual key;
将明文和所述虚拟密钥进行运算得到密文的加密装置。  The ciphertext encryption device is obtained by calculating the plaintext and the virtual key.
根据本发明的另一个方面,提供一种混沌密码流解密的系统,包括下述装 置:  According to another aspect of the present invention, a system for chaotic cryptographic stream decryption is provided, comprising the following means:
将存储器中的对称密钥值进行混沌映射, 以产生混沌值的混沌映射装置; 将所述混沌值舍位, 并将部分混沌值反向的转换装置;  a chaotic mapping device that performs chaotic mapping on a symmetric key value in a memory to generate a chaotic value; a conversion device that rounds the chaotic value and reverses a partial chaotic value;
将所述混沌值合并组成虚拟密钥的密钥生成装置;  Combining the chaotic values into a key generation device that constitutes a virtual key;
将密文和所述虚拟密钥进行运算以得到明文的解密装置。  The ciphertext and the virtual key are operated to obtain a plaintext decryption device.
本发明的加密方法完全取决于初始参数, 因此,在非法解密者不知道初始 参数的情况下更难被解密。此外,本发明提出的方法和系统还可应用于任何需 要加密的领域。  The encryption method of the present invention is completely dependent on the initial parameters and, therefore, is more difficult to decrypt if the illegal decryptor does not know the initial parameters. Moreover, the method and system proposed by the present invention are also applicable to any field requiring encryption.
附图说明 DRAWINGS
下面将结合附图及实施例对本发明作进一步说明, 附图中:  The present invention will be further described below in conjunction with the accompanying drawings and embodiments, in which:
图 1是本发明加密系统的模块图;  Figure 1 is a block diagram of an encryption system of the present invention;
图 2是本发明解密系统的模块图;  Figure 2 is a block diagram of the decryption system of the present invention;
图 3是本发明应用混沌密码流加密的流程图;  3 is a flow chart of applying chaotic cipher stream encryption according to the present invention;
图 4是本发明应用混沌密码流解密的流程图。  4 is a flow chart of the application of chaotic cipher stream decryption in the present invention.
具体实施方式 图 1是本发明加密系统的模块图。如图 1所示,本发明的加密系统包括存 储器 102, 产生并储存对称密钥的随机数字生成装置 101, 将产生的对称密钥 值混沌映射, 以产生混沌值的混沌映射装置 103, 将所述混沌值舍位, 并将部 分混沌值反向的转换装置 104, 将所述混沌值合并组成虚拟密钥的密钥生成装 置 105, 将明文和所述虚拟密钥进行运算得到密文的加密装置 106。 detailed description 1 is a block diagram of an encryption system of the present invention. As shown in FIG. 1, the encryption system of the present invention includes a memory 102, a random number generating device 101 that generates and stores a symmetric key, and chaotic mapping of the generated symmetric key values to generate a chaotic value chaotic mapping device 103. The conversion device 104 that chases the chaotic value and reverses the partial chaotic value, merges the chaotic value into the key generation device 105 that constitutes the virtual key, and performs the encryption operation on the plaintext and the virtual key to obtain the ciphertext encryption. Device 106.
图 2是本发明解密装置的模块图。如图 2所示,本发明的解密系统包括将 存储器中的对称密钥值进行混沌映射, 以产生混沌值的混沌映射装置 201, 将 所述混沌值舍位, 并将部分混沌值反向的转换装置 202, 将所述混沌值合并组 成虚拟密钥的密钥生成装置 203, 将密文和所述虚拟密钥进行运算以得到明文 的解密装置 204。  2 is a block diagram of a decryption apparatus of the present invention. As shown in FIG. 2, the decryption system of the present invention includes a chaotic mapping device 201 that performs chaotic mapping of symmetric key values in a memory to generate chaotic values, truncating the chaotic values, and inverting partial chaotic values. The converting means 202 combines the chaotic values into a key generation means 203 which constitutes a virtual key, and operates the ciphertext and the virtual key to obtain a plaintext decryption means 204.
图 3是本发明应用混沌密码流加密的流程图。结合图 1对加密流程进行详 细描述。 步骤 300, 随机数字生成装置 101产生对称密钥 k, 该密钥 k可以是 可变的长度, 在本实施例中采用了 32字节的长度, 该密钥 k存储以 0到 255 的 ASCII值存储。步骤 305,对称密钥 k存储于数据库 102中以用于解密处理。 步骤 310, 密钥值 k被放入混沌映射装置中, 在混沌映射多次后, 产生一个混 沌值。 步骤 315, 该混沌值由转换装置 104舍位为整数值, 例如, 0.12345被 截为 12345,并且某些混沌值由转换装置 104反向,例如, 12345颠倒为 54321。 步骤 320,密钥生成装置将所有混沌值组成一个虚拟密钥 S,例如, 12345.54321 等组成 1234554321...。 S值的长度根据不同的对称密钥变化。 步骤 325, 明文 P被读入加密装置 106。步骤 330, 明文 P与虚拟密钥 S多次执行运算, 例如, 异或运算, 以确保加密文本的随机性, 在此, 产生加密信息 C。  3 is a flow chart of applying chaotic cipher stream encryption according to the present invention. The encryption process is described in detail in conjunction with Figure 1. Step 300, the random number generating means 101 generates a symmetric key k, which may be of variable length. In the present embodiment, a length of 32 bytes is used, and the key k stores an ASCII value of 0 to 255. storage. In step 305, the symmetric key k is stored in the database 102 for decryption processing. In step 310, the key value k is placed in the chaotic mapping device, and after the chaotic mapping is performed multiple times, a chaotic value is generated. Step 315, the chaotic value is truncated by the conversion device 104 to an integer value, for example, 0.12345 is truncated to 12345, and some chaotic values are reversed by the conversion device 104, for example, 12345 is inverted to 54321. Step 320: The key generation device combines all the chaotic values into a virtual key S, for example, 12345.54321, etc. to form 1234554321.... The length of the S value varies according to different symmetric keys. Step 325, the plaintext P is read into the encryption device 106. In step 330, the plaintext P and the virtual key S perform operations multiple times, for example, an exclusive OR operation to ensure randomness of the encrypted text, where the encrypted information C is generated.
密钥 k是具有一定数量字节的对称密钥, 每个字节包括一个 0至 255 (十 六进制值 00至 FF)的 ASCII值。所述密钥用于放入对数映射以产生一个数值 用于将来的加密 /解密处理。  The key k is a symmetric key with a certain number of bytes, and each byte includes an ASCII value of 0 to 255 (hexadecimal value 00 to FF). The key is used to place a logarithmic map to produce a value for future encryption/decryption processing.
混沌值 (dn) 是插入 kn的混沌映射产生的结果值。 The chaotic value (d n ) is the resulting value of the chaotic map inserted into k n .
^是^的小数部分, 整数部分被截取, 随后小数部分被反向。  ^ is the fractional part of ^, the integer part is truncated, and then the fractional part is reversed.
P是明文, 即加密前的信息。  P is plaintext, that is, information before encryption.
C是密文, 即加密后的信息。 混沌映射是密码技术的核心部分。 选择对数映射, 如下所示: x n+1 = a ' xn ' (l - xn ) C is ciphertext, that is, encrypted information. Chaotic mapping is a core part of cryptography. Select the logarithmic map as follows: x n+1 = a ' x n ' (l - x n )
a是对数映射的参数, 因为对数映射的分支特性会成倍的增加映射周期以 变成混沌, 所以 a通常设为大于 3。  a is a parameter of the logarithmic mapping, because the branching property of the logarithmic mapping multiplies the mapping period to become chaotic, so a is usually set to be greater than 3.
X的值设为 0到 1。  The value of X is set to 0 to 1.
n表示在对数映射内的第 n次重复, 重复的次数可变, 并且通常设为大于 n represents the nth repetition within the logarithmic map, the number of repetitions is variable, and is usually set to be greater than
100。 100.
不仅对数映射可用于本发明加密 /解密技术的核心部分, 任何其它类型的 混沌映射也可用于本发明的密码技术的核心部分。此处采用对数映射的原因是 这个等式简单, 不需要过多计算的资源, 但其结果却复杂。本发明中的处理在 密文的随机性和加密 /解密处理的速度之间找到了平衡点。  Not only is logarithmic mapping available to the core of the encryption/decryption technique of the present invention, but any other type of chaotic mapping can be used in the core portion of the cryptographic technique of the present invention. The reason for using logarithmic mapping here is that this equation is simple, does not require too many computational resources, but the results are complex. The processing in the present invention finds a balance between the randomness of ciphertext and the speed of encryption/decryption processing.
所述示例性加密源代码如下: ' The exemplary encryption source code is as follows: '
II版本 3.1 II version 3.1
II可变密钥长度的混沌编码  II chaotic coding of variable key length
II写出密钥分离文件  II write out the key separation file
package enc; Package enc;
import java.io.*; Import java.io.*;
import java.util.*; Import java.util.*;
import java.text.*; Import java.text.*;
import java.lang.*; import sun.misc.BASE64Decoder; Import java.lang.*; import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder; public class CEncrypt_file02 Import sun.misc.BASE64Encoder; public class CEncrypt_file02
{ {
II 管理数据文档  II Management Data Document
FilelnputStream dataFisOl ; BufferedlnputStream dataFis; FilelnputStream dataFisOl ; BufferedlnputStream dataFis;
II密钥文档 II key document
FileOutputStream kfileOl; FileOutputStream kfileOl;
BufferedOutputStream kfile; BufferedOutputStream kfile;
II加密文档 II encrypted document
FileOutputStream defileOl ; FileOutputStream defileOl ;
BufferedOutputStream defile; BufferedOutputStream defile;
final int KEY_SIZE = 32; Final int KEY_SIZE = 32;
final int MSG_SIZE = 16;  Final int MSG_SIZE = 16;
byte load_key[] = new byte [KEY— SIZE]; Byte load_key[] = new byte [KEY_ SIZE];
private String chaosstring = ""; Private String chaosstring = "";
byte map— key口; Byte map—key port;
File key— file— name;  File key— file— name;
private String ftiame = ""; Private String ftiame = "";
private String fext = ""; Private String fext = "";
public CEncrypt_file02(File filename, File dirname) { Public CEncrypt_file02(File filename, File dirname) {
II打幵密钥文档和文本文档  II snoring key documents and text documents
if (filename == null || filename. equals(" "))  If (filename == null || filename. equals(" "))
{  {
System.err.println("Invalid Source Path File Name"); return; System.err.println("Invalid Source Path File Name"); Return;
}  }
else if (dirname null || dirname.equals("")) Else if (dirname null || dirname.equals(""))
{ {
System. err.println(" Invalid Destination Path Name");  System. err.println(" Invalid Destination Path Name");
return;  Return;
}  }
else Else
{  {
try  Try
{  {
II打开输入文本文档, 并建立输出文本文档  IIOpen the input text document and create an output text document
dataFisOl = new FilelnputStream(fllename);  dataFisOl = new FilelnputStream(fllename);
dataFis = new BufferedInputStream(dataFisO 1 );  dataFis = new BufferedInputStream(dataFisO 1 );
II获得文档名和扩展, 并加入尾部空格 II Get the document name and extension, and add trailing spaces
String tt = filename.getName();  String tt = filename.getName();
fhame = tt.substring(0, tt.lastIndexOf(".")); fext = tt.substring(tt.lastIndexOf(" . ")+ 1 );  Fhame = tt.substring(0, tt.lastIndexOf(".")); fext = tt.substring(tt.lastIndexOf(" . ")+ 1 );
int num_sp = 5-fext.length();  Int num_sp = 5-fext.length();
for (int i = 0; i < num_sp; i++)  For (int i = 0; i < num_sp; i++)
{  {
fext = fext + " ";  Fext = fext + " ";
}  }
II建立密钥文档 II Establish a key document
File key— output = new File(dirname + "\\" + fhame + ".ckl"); kfileOl = new FileOutputStream(key_output); kfile = new BufferedOutputStream(kfile01 ); byte口 strKey = KeyGenerator(); File key— output = new File(dirname + "\\" + fhame + ".ckl"); kfileOl = new FileOutputStream(key_output); Kfile = new BufferedOutputStream(kfile01 ); byte port strKey = KeyGenerator();
for(int i = 0; i < KEY— SIZE; i++) For(int i = 0; i < KEY— SIZE; i++)
{ {
writeBuffer02(strKey[i]);  writeBuffer02(strKey[i]);
}  }
form— key (); Form— key ();
//建立输出文档 / / Create an output document
File encrypt— output = new File(dirname +"\\" + fhame + " ef); defileOl ^ new FileOutputStream(encrypt_output);  File encrypt_ output = new File(dirname +"\\" + fhame + " ef); defileOl ^ new FileOutputStream(encrypt_output);
defile = new BufferedOutputStream(defile01 );  Defile = new BufferedOutputStream(defile01 );
II对文档扩展加密 II extended file encryption
byte口 fx = fext.getBytes(); Byte port fx = fext.getBytes();
for(int i = 0; i < fx. length; i++) For(int i = 0; i < fx. length; i++)
{  {
writeBuffer(xor_opt(i, fx[i]));  writeBuffer(xor_opt(i, fx[i]));
}  }
II读取原文档内容 II read the original document content
int intCount = 5; Int intCount = 5;
int fcontent;  Int fcontent;
while ((fcontent = dataFis.readQ) != -1) writeBuffer(xor_opt(intCount-3,xor_opt(intCount-5,xor_opt(intCount:) fcontent)))); While ((fcontent = dataFis.readQ) != -1) writeBuffer(xor_opt(intCount-3, xor_opt(intCount-5, xor_opt(intCount :) fcontent))));
intCount++;  intCount++;
defile. flush(); Defile. flush();
defileOl.flushO; dataFis.close();  defileOl.flushO; dataFis.close();
defile.close();  Defile.close();
kfile.close();  Kfile.close();
dataFis01.close(); dataFis01.close();
defile01.close();  Defile01.close();
kfileOl.closeO;  kfileOl.closeO;
}  }
catch (lOException ioException)  Catch (lOException ioException)
{  {
System. out.println("ioException " + ioException);  System. out.println("ioException " + ioException);
return;  Return;
}  }
}  }
}  }
II使用特定的密钥流对文档加密 II encrypts documents using a specific key stream
public CEncrypt_file02(File filename, File dimame, String key) {  Public CEncrypt_file02(File filename, File dimame, String key) {
II打开密钥文档和文本 if (filename = null || filename. equals("")) II Open key document and text If (filename = null || filename. equals(""))
{ {
System.err.println("Invalid Source Path File Name"); return;  System.err.println("Invalid Source Path File Name"); return;
}  }
else if (dirname == null || dirname.equals("")) Else if (dirname == null || dirname.equals(""))
{  {
System. err.println(" Invalid Destination Path Name"); return;  System. err.println(" Invalid Destination Path Name"); return;
}  }
else { Else {
try {  Try {
II打开输入文本文档, 并建立输出文本文档 dataFisOl = new FilelnputStream(filename); dataFis = new BufferedInputStream(dataFisO 1);  II Open the input text document and create an output text document dataFisOl = new FilelnputStream(filename); dataFis = new BufferedInputStream(dataFisO 1);
II获得文档名和扩展, 并加入尾部空格 String tt = filename.getName(); II Get the document name and extension, and add a trailing space String tt = filename.getName();
foame = tt.substring(0, tt.lastIndexOf(" . ")); fext = tt.substring(tt.lastIndexOf(".")+l); int num_sp = 5-fext.length();  Foame = tt.substring(0, tt.lastIndexOf(" . ")); fext = tt.substring(tt.lastIndexOf(".")+l); int num_sp = 5-fext.length();
for (int i = 0; i < num_sp; i++)  For (int i = 0; i < num_sp; i++)
{  {
fext = fext + " ";  Fext = fext + " ";
} II建立密钥文档 } II Establish a key document
/*  /*
File key一 output = new File(dimame +"\\"+ fhame + ".ckl"); kfileO 1 = new FileOutputStream(key_output);  File key - output = new File(dimame +"\\"+ fhame + ".ckl"); kfileO 1 = new FileOutputStream(key_output);
kflle■= new BufferedOutputStream(kfile01 );  Kflle■= new BufferedOutputStream(kfile01 );
byte[】 strKey = KeyGenerator(); Byte[] strKey = KeyGenerator();
for(int i = 0; i < KEY— SIZE; i++)  For(int i = 0; i < KEY— SIZE; i++)
{  {
writeBuffer02(strKey[i]);  writeBuffer02(strKey[i]);
}  }
*/  */
BASE64Decoder decoder = new BASE64Decoder();  BASE64Decoder decoder = new BASE64Decoder();
load— key = decoder. decodeBuffer(key); Load— key = decoder. decodeBuffer(key);
form_key();  Form_key();
II建立输出文档 II establish an output document
File encrypt— output― new File(dirname +"\\" + fhame + ".cef ); defileOl = new FileOutputStream(encrypt_output);  File encrypt_ output― new File(dirname +"\\" + fhame + ".cef ); defileOl = new FileOutputStream(encrypt_output);
defile = new BufferedOutputStream(defile01 );  Defile = new BufferedOutputStream(defile01 );
II对文档的扩展加密 II extended encryption of documents
byte口 fx = fext.getBytes();  Byte port fx = fext.getBytes();
for(int i = 0; i < fx.length;  For(int i = 0; i < fx.length;
{  {
writeBuffer(xor_opt(i, fx[i]));  writeBuffer(xor_opt(i, fx[i]));
} II读取源文档内容 } II read the source document content
int intCount = 5;  Int intCount = 5;
int fcontent;  Int fcontent;
while ((fcontent = dataFis.read()) != -1) While ((fcontent = dataFis.read()) != -1)
{ miteBuffer(xor_opt(intComit-3,xor_opt(intCount-5,xor_opt(intCount. fcontent))));  { miteBuffer(xor_opt(intComit-3,xor_opt(intCount-5,xor_opt(intCount. fcontent))));
intCount++;  intCount++;
} defile.flush();  } defile.flush();
defileOl.flushO;  defileOl.flushO;
dataFis.close(); dataFis.close();
defile.close();  Defile.close();
//kfile.close(); -  //kfile.close(); -
dataFis01.close(); dataFis01.close();
defile01.close();  Defile01.close();
//kfileOLcloseO;  //kfileOLcloseO;
}  }
catch (lOException ioException) {  Catch (lOException ioException) {
System.out.println("ioException " + ioException);  System.out.println("ioException " + ioException);
return;  Return;
} } } }
}  }
II产生密钥  II generating a key
public byte口 KeyGenerator() Public byte port KeyGenerator()
{ {
int intKeyGen[] = new int[KEY_SIZE]; for (int n = 0; n < KEY— SIZE; n++)  Int intKeyGen[] = new int[KEY_SIZE]; for (int n = 0; n < KEY- SIZE; n++)
{  {
intKeyGen[n] = new j ava.util . Random() .nextlnt(256);  intKeyGen[n] = new j ava.util . Random() .nextlnt(256);
load_key[n] = (byte) intKeyGen[n];  Load_key[n] = (byte) intKeyGen[n];
//System.out.println("load_key[" + n + "] =" + load— key[n]); //System.out.println("load_key[" + n + "] =" + load- key[n]);
} }
return load— key;  Return load— key;
}  }
II产生随机密钥 II generates a random key
public static String genKey(){ Public static String genKey(){
final int KEY_SIZE=32;  Final int KEY_SIZE=32;
byte key[] = new byte [KEY—SIZE];  Byte key[] = new byte [KEY_SIZE];
String keytxt = new String(); int int eyGen[] = new int[KEY— SIZE]; for (int 11 = 0; n < KEY— SIZE; n++)  String keytxt = new String(); int int eyGen[] = new int[KEY— SIZE]; for (int 11 = 0; n < KEY— SIZE; n++)
{  {
intKeyGen[n] = new j ava . util . Random() .nextlnt(256); key[n] = (byte) intKeyGen[n]; //System.out.println("load_key[" + n + "]— ' + load一 key[n]);intKeyGen[n] = new j ava . util . Random() .nextlnt(256); key[n] = (byte) intKeyGen[n]; //System.out.println("load_key[" + n + "]- ' + load-key[n]);
} }
II返还 load— key;  II return load-key;
System. out.println(new String(key));  System. out.println(new String(key));
BASE64Encoder encoder64 = new BASE64Encoder();  BASE64Encoder encoder64 = new BASE64Encoder();
keytxt = encoder64.encode(key);  Keytxt = encoder64.encode(key);
return keytxt;  Return keytxt;
}  }
II使用密钥中给定的用户名产生密钥  II generates a key using the given username in the key
public static String genKey(String str) { Public static String genKey(String str) {
final int KEY_SIZE=32;  Final int KEY_SIZE=32;
byte key口 = new byte[KEY— SIZE];  Byte key port = new byte[KEY_ SIZE];
String keytxt = new String();  String keytxt = new String();
int intKeyGen[] = new int[KEY_SIZE]; Int intKeyGen[] = new int[KEY_SIZE];
for (int n = 0; n < KEY_SIZE-str.length(); n++) { For (int n = 0; n < KEY_SIZE-str.length(); n++) {
intKeyGen[n] = new java.util.Random().nextInt(256);  intKeyGen[n] = new java.util.Random().nextInt(256);
key[n] = (byte) intKeyGen[n];  Key[n] = (byte) intKeyGen[n];
//System.out.println("load_key[" + n + "]— ' + load_key[n]); //System.out.println("load_key[" + n + "]- ' + load_key[n]);
} }
int count = 0;  Int count = 0;
for (int n = KEY_SIZE-str.length(); n < KEY— SIZE;n++){ key[n] = (byte)((int)str.charAt(count) + 32);  For (int n = KEY_SIZE-str.length(); n < KEY— SIZE;n++){ key[n] = (byte)((int)str.charAt(count) + 32);
count++;  Count++;
}  }
II返还 load— key; System. out.println(new String(key)); II return load-key; System. out.println(new String(key));
BASE64Encoder encoder64 = new BASE64Encoder(); keytxt = encoder64. encode(key);  BASE64Encoder encoder64 = new BASE64Encoder(); keytxt = encoder64. encode(key);
return keytxt;  Return keytxt;
}  }
II从混沌密钥输入密钥值用于加密 II Enter the key value from the chaotic key for encryption
II如果加密文档不能够被解密  II if the encrypted document cannot be decrypted
II可能是密钥传递至对数映 时浮点错误  II may be a floating point error when the key is passed to the logarithmic map
private void form— key() {  Private void form— key() {
II将密钥输入对数映射并产生小数值  II Enter the key into the logarithmic map and generate a small value
for (int i = 0; i < KEY— SIZE; i++)  For (int i = 0; i < KEY- SIZE; i++)
{  {
double nvalue = calc_opt(i);  Double nvalue = calc_opt(i);
String nsvalue = Double.toString(nvalue);  String nsvalue = Double.toString(nvalue);
nsvalue = nsvalue.substring(nsvalue.lastIndexOf(".")+l); Nsvalue = nsvalue.substring(nsvalue.lastIndexOf(".")+l);
StxingBuffer sb = new StringBuffer(); StxingBuffer sb = new StringBuffer();
sb . append(nsvalue);  Sb . append(nsvalue);
nsvalue = sb.reverse().toString();  Nsvalue = sb.reverse().toString();
chaosstring = chaosstring + nsvalue;  Chaosstring = chaosstring + nsvalue;
}  }
int ct = (int) Math.ceil((double) chaosstring.length()/2);  Int ct = (int) Math.ceil((double) chaosstring.length()/2);
map— key = new byte[ct]; Map— key = new byte[ct];
int subct=0;  Int subct=0;
int subct—ed = 2;  Int subct—ed = 2;
for (int i = 0; i < ct; i++) { For (int i = 0; i <ct; i++) {
if (subct—ed > chaosstring.length())  If (subct_ed > chaosstring.length())
{  {
subct—ed--;  Subct—ed--;
}  }
String tp = chaosstring.substring(subct, subct—ed); map— key[i] = Byte.parseB te(tp);  String tp = chaosstring.substring(subct, subct-ed); map— key[i] = Byte.parseB te(tp);
if(i % 2 == 0)  If(i % 2 == 0)
map_key[i] = (byte) (255 - map_key[i]);  Map_key[i] = (byte) (255 - map_key[i]);
else  Else
map—key [i] = map— key [i];  Map—key [i] = map— key [i];
System.out.println("map_key["+i+"] System.out.println("map_key["+i+"]
subct+=2;  Subct+=2;
subct ed+=2:  Subct ed+=2:
private double LogisticMap(int k) Private double LogisticMap(int k)
{ {
double b = 3.78;  Double b = 3.78;
double lm = ( (double) k / 512);  Double lm = ( (double) k / 512);
for (int loop = 0; loop < k; loop++)  For (int loop = 0; loop < k; loop++)
{  {
lm = b * lm * (1 - lm);  Lm = b * lm * (1 - lm);
return Math.abs(lm); } Return Math.abs(lm); }
II将噪音加入管理数据 II Add noise to management data
private double calc_opt(int loop— count)  Private double calc_opt(int loop— count)
II对文档内容执行异或操作 II Execute XOR operation on document content
private byte xor— opt (int loop— count, int pvalue)  Private byte xor— opt (int loop— count, int pvalue)
II转换为二进制并输出文档 Convert to binary and output the document
private void writeBuffer(byte s)  Private void writeBuffer(byte s)
II输出密钥文档 II output key document
private void writeBuffer02(byte s)  Private void writeBuffer02(byte s)
} 图 4是本发明文档读取模块对信息解密的流程图。 步骤 405, 密钥值被放 入混沌映射装置 201中, 在混沌映射多次后, 产生一个混沌值。 步骤 410, 该 混沌值由转换装置 202舍位为整数值, 例如, 0.12345被截为 12345, 并且某 些混沌值被转换装置 202反向, 例如, 12345颠倒为 54321。 步骤 415, 密钥 生成装置 203将所有混沌值组成一个虚拟密钥 S, 例如, 12345、 54321等组成 1234554321...。 S值的长度根据不同的对称密钥变化。 步骤 420, 密文 C被读 入存储器。 步骤 425, 加密信息 C与虚拟密钥 S多次执行运算, 例如, 异或运 算, 以产生原始信息?。  FIG. 4 is a flow chart of decrypting information by the document reading module of the present invention. Step 405, the key value is placed in the chaotic mapping device 201, and after the chaotic mapping is performed multiple times, a chaotic value is generated. In step 410, the chaotic value is truncated by the converting means 202 to an integer value. For example, 0.12345 is truncated to 12345, and some chaotic values are reversed by the converting means 202, for example, 12345 is inverted to 54321. Step 415, the key generation means 203 combines all the chaotic values into a virtual key S, for example, 12345, 54321, etc. to constitute 1234554321.... The length of the S value varies according to different symmetric keys. In step 420, ciphertext C is read into the memory. Step 425, the encrypted information C and the virtual key S perform operations multiple times, for example, XOR operations to generate original information. .
所述示例性解密源代码如下:  The exemplary decryption source code is as follows:
II版本 3.1 II version 3.1
II各种密钥长度的混沌解密  II chaotic decryption of various key lengths
II从分离的文档输入读取 II read from separate document input
package enc; import java.io.*; Package enc; Import java.io.*;
import java.util.*; Import java.util.*;
import java.text.*; Import java.text.*;
import java.lang.*; import sun.misc.BASE64Decoder; public class CDecrypt_file02 { Import java.lang.*; import sun.misc.BASE64Decoder; public class CDecrypt_file02 {
//初始化变量  //Initialize variables
FilelnputStream infileOl; II加密数据输入流  FilelnputStream infileOl; II encrypted data input stream
BufferedlnputStream infile;  BufferedlnputStream infile;
FilelnputStream kfileO 1; II密钥输入流  FilelnputStream kfileO 1; II key input stream
BufferedlnputStream kfile;  BufferedlnputStream kfile;
FileOutputStream defileOl;  FileOutputStream defileOl;
BufferedOutputStream defile; final int KEY— SIZE = 32;  BufferedOutputStream defile; final int KEY— SIZE = 32;
final int MSG— SIZE = 16; byte load— key口 = new byte [KEY— SIZE];  Final int MSG— SIZE = 16; byte load—key port = new byte [KEY— SIZE];
private String chaosstring = "";  Private String chaosstring = "";
byte map_key[];  Byte map_key[];
String strKey = "";  String strKey = "";
public String ihame = "";  Public String ihame = "";
public String fext = ""; public CDecrypt_file02(File filename, File key— file, File dimame) Public String fext = ""; public CDecrypt_file02(File filename, File key- file, File dimame)
{ II打开密钥文档和文本文档 { II Open key document and text document
if (filename == null || filename. equals("")) If (filename == null || filename. equals(""))
{  {
System.err.printlnC'Invalid Source File Path Name"); System.err.printlnC'Invalid Source File Path Name");
//System.exit(l); //System.exit(l);
return;  Return;
}  }
else if (dirname == null || dirname.equals("")) Else if (dirname == null || dirname.equals(""))
{  {
System.err.printlnC'Invalid Destination Path Name"); return;  System.err.printlnC'Invalid Destination Path Name"); return;
//System.exit(l);  //System.exit(l);
}  }
else Else
{ {
try  Try
{  {
II使用管理文档名作为解密文档名  II uses the management document name as the decrypted document name
String tt = filename.getName();  String tt = filename.getName();
fname = tt.substring(0, tt.lastIndexOf(" . ")); Fname = tt.substring(0, tt.lastIndexOf(" . "));
II打开密钥文档 II open key document
kfileOl = new FileInputStream(key_file);  kfileOl = new FileInputStream(key_file);
kfile = new BufferedInputStream(kfileO 1 );  Kfile = new BufferedInputStream(kfileO 1 );
II从 keyjile读取密钥 II read the key from keyjile
kfile.read(load_key);  Kfile.read(load_key);
form_key(); II打开输入文本文档并建立输出文本文档 Form_key(); IIOpen the input text document and create an output text document
infileOl = new FilelnputStream(filename); II open text file infileOl = new FilelnputStream(filename); II open text file
infile - new BufferedInputStream(infileO 1 ); Infile - new BufferedInputStream(infileO 1 );
II读取源文档内容 II read the source document content
int char ct = 0;  Int char ct = 0;
II文档扩展 II document extension
String fext =  String fext =
byte[] cext = new byte [5];  Byte[] cext = new byte [5];
infile. read(cext);  Infile. read(cext);
for (int i = 0; i < 5; i++)  For (int i = 0; i < 5; i++)
{  {
fext = fext + (char) xor_opt(i, cext[i]);  Fext = fext + (char) xor_opt(i, cext[i]);
}  }
II解密文档路径和名称 II decrypt document path and name
File fileOut = new File(dirname + "\\" + fhame + "." + fext.trim()); defileOl = new FileOutputStream(fileOut);  File fileOut = new File(dirname + "\\" + fhame + "." + fext.trim()); defileOl = new FileOutputStream(fileOut);
defile = new BufferedOutputStream(defile01 );  Defile = new BufferedOutputStream(defile01 );
II读取源文档内容 II read the source document content
int intCount = 5; Int intCount = 5;
int rem = 0; Int rem = 0;
int fcontent;  Int fcontent;
while ((fcontent = infile. read()) != -1) { writeBuffer(xor_opt(intCount,xor_opt(intCount-5,xor_opt(intCount-3, fcontent)))); While ((fcontent = infile. read()) != -1) { writeBuffer(xor_opt(intCount, xor_opt(intCount-5, xor_opt(intCount-3, fcontent))));
intCount++;  intCount++;
} defile. flush();  } defile. flush();
defileOl.flushO;  defileOl.flushO;
infile.close(); Infile.close();
defile. close();  Defile. close();
kfile.close();  Kfile.close();
infile01.close(); Infile01.close();
defile01.close();  Defile01.close();
kfile01.close();  Kfile01.close();
}  }
catch (IOException ioException)  Catch (IOException ioException)
{  {
//System. out.println(" ioException " + ioException.getMessage()); ioException.printStackTrace();  //System. out.println(" ioException " + ioException.getMessage()); ioException.printStackTrace();
//System.exit(l);  //System.exit(l);
return;  Return;
}  }
public CDeci-ypt_file02(File filename, String key, File dimame) II打开密钥文档和文本文档 if (filename == null || filename.equals("")) { Public CDeci-ypt_file02(File filename, String key, File dimame) II Open the key document and text document if (filename == null || filename.equals("")) {
System.err.printlnC'Invalid Source File Path Name"); return;  System.err.printlnC'Invalid Source File Path Name"); return;
//System.exit(l);  //System.exit(l);
}  }
else if (dimame == null || dimame. equals("")) Else if (dimame == null || dimame. equals(""))
{ {
System.err.printlnC'Invalid Destination Path Name"); return;  System.err.printlnC'Invalid Destination Path Name"); return;
//System.exit(l);  //System.exit(l);
}  }
else { Else {
try {  Try {
II使用管理文档名作为解密的文档名  II uses the management document name as the decrypted document name
String tt = filename . getName();  String tt = filename . getName();
fname = tt.substring(0, tt.lastIndexOf("."));  Fname = tt.substring(0, tt.lastIndexOf("."));
II打开密钥文档 II open key document
/*  /*
kflleOl = new FileInputStream(key_file);  kflleOl = new FileInputStream(key_file);
kfile = new BufferedInputStream(kfileO 1 ); II从 key— file读取密钥 Kfile = new BufferedInputStream(kfileO 1 ); II reads the key from the key file
kfile.read(load_key);  Kfile.read(load_key);
*/  */
BASE64Decoder decoder = new BASE64Decoder();  BASE64Decoder decoder = new BASE64Decoder();
load— key = decoder.decodeBuffer(key); Load— key = decoder.decodeBuffer(key);
Figure imgf000024_0001
Figure imgf000024_0001
II打开输入文本文档并建立输出文本文档 infileOl = new FilelnputStream(filename); II open text file infile = new BufferedInputStream(infileO 1 ); II Open the input text document and create an output text document infileOl = new FilelnputStream(filename); II open text file infile = new BufferedInputStream(infileO 1 );
II读取源文档内容 Read source file content int char ct = 0; II read the source document content Read source file content int char ct = 0;
//文档扩展 / / Document extension
String fext = "";  String fext = "";
byte[] cext =■ new byte [5];  Byte[] cext =■ new byte [5];
infile.read(cext);  Infile.read(cext);
for (int i = 0; i < 5; i++)  For (int i = 0; i < 5; i++)
{  {
fext = fext + (char) xor_opt(i, cext[i]);  Fext = fext + (char) xor_opt(i, cext[i]);
}  }
II解密文档路径和名称 II decrypt document path and name
File fileOut = new File(dirname + "\\" + fi ame + "." +
Figure imgf000024_0002
File fileOut = new File(dirname + "\\" + fi ame + "." +
Figure imgf000024_0002
defileOl = new FileOutputStream(fileOut);  defileOl = new FileOutputStream(fileOut);
defile = new BufferedOutputStream(defile01 ); ppO;e ioExction.rntStackTiraceDefile = new BufferedOutputStream(defile01 ); ppO;e ioExction.rntStackTirace
yp(ppggo); //ss.otemut.rointlniExcetnio iocoExetin.etMessae +" - (pp)athO cclExcetion ioExceti>on O;/ /kfileOl.close Yp(ppggo); //ss.otemut.rointlniExcetnio iocoExetin.etMessae +" - (pp)athO cclExcetion ioExceti>on O;/ /kfileOl.close
Figure imgf000025_0001
o;oo dejsel.clse
Figure imgf000025_0001
o;oo dejsel.clse
O; ifeO.closnille o; //oskfileble O; ifeO.closnille o; //oskfileble
o; denosle.cle o; denosle.cle
o; infileblose o; defleousllh o; infileblose o; defleousllh
o; defue.fhlsh ; intcount++ o; defue.fhlsh ; intcount++
)))); fcontent )))); fcontent
(—p(lp(¾lp(,, wuiteBfferxorotcointtroticontunt5oxr。tintcount3--  (—p(lp(3⁄4lp(,, wuiteBfferxorotcointtroticontunt5oxr.tintcount3--
((O)) whilefcontent infile.read T1 = - ; int fcontent ;n it intcount 5H return; ((O)) whilefcontent infile.read T1 = - ; int fcontent ;n it intcount 5H Return;
//System.exit(l);  //System.exit(l);
}
Figure imgf000026_0001
}
Figure imgf000026_0001
II从混沌密钥输入密钥值用作加密 II from the chaotic key input key value used as encryption
private void form_key() Private void form_key()
{  {
for (int i = 0; i < KEY— SIZE; {  For (int i = 0; i < KEY- SIZE; {
double nvalue = calc_opt(i);  Double nvalue = calc_opt(i);
String nsvalue = Double.toString(nvalue);  String nsvalue = Double.toString(nvalue);
nsvalue = nsvalue. substring(nsvalue.lastIndexOf(".")+l); Nsvalue = nsvalue. substring(nsvalue.lastIndexOf(".")+l);
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append(nsvalue);  Sb.append(nsvalue);
nsvalue = sb.reverse().toString();  Nsvalue = sb.reverse().toString();
chaosstring = chaosstring + nsvalue;  Chaosstring = chaosstring + nsvalue;
}  }
int ct = (int) Mat .ceil((double) chaosstring.length()/2);  Int ct = (int) Mat .ceil((double) chaosstring.length()/2);
map— key = new byte[ct]; Map— key = new byte[ct];
int subct=0;  Int subct=0;
int subct—ed = 2;  Int subct—ed = 2;
for (int i = 0; i < ct; i++)  For (int i = 0; i < ct; i++)
{  {
if (subct—ed > chaosstring.lengt ()) { If (subct_ed > chaosstring.lengt ()) {
subct__ed~;  Subct__ed~;
} }
String tp = chaosstring.substring(s bct, s bct_ed); map_key[i] = Byte.parseByte(tp);  String tp = chaosstring.substring(s bct, s bct_ed); map_key[i] = Byte.parseByte(tp);
if (i % 2 == 0)  If (i % 2 == 0)
map_key[i] = (byte) (255 - map— key[i]);  Map_key[i] = (byte) (255 - map— key[i]);
else  Else
map— key [i] = map_key[i];  Map— key [i] = map_key[i];
System.out.println("map—key["+i+"]="+map—key[i]); subct+=2;  System.out.println("map-key["+i+"]="+map-key[i]); subct+=2;
subct_ed+=2;  Subct_ed+=2;
} }
}  }
II输入密钥值, 限制为 0- >1的值, II Enter the key value, limited to a value of 0->1,
II运行对数映射 k次, 返还结果被密钥值乘  II runs the logarithmic map k times, the return result is multiplied by the key value
private double LogisticMap(int k) Private double LogisticMap(int k)
private double calc_opt(int loop— count) Private double calc_opt(int loop— count)
II文档的异或操作 II document XOR operation
private byte xor— opt (int loop— count, int pvalue)  Private byte xor— opt (int loop— count, int pvalue)
II转换为二进制数据并输出文档 II converts to binary data and outputs the document
private void writeBuffer(byte s) Private void writeBuffer(byte s)

Claims

权 利 要 求  Rights request
1、 一种应用混沌密码流加密的方法, 其特征在于, 包括以下步骤:A method for applying chaotic cipher stream encryption, characterized in that it comprises the following steps:
51. 随机产生对称密钥, 并储存于存储器; 权 2中提到 51. Randomly generate a symmetric key and store it in memory; mentioned in right 2
52. 将 S1产生的对称密钥混沌映射, 以产生混沌值;  52. Chaotically map the symmetric key generated by S1 to generate a chaotic value;
53. 将所述混沌值舍位, 并将部分 (如何确定) 混沌值反向; (加一个步 骤写反向)  53. Round the chaotic value and reverse the partial (how to determine) chaotic value; (plus one step to write the reverse)
54. 将 S3中截位 (从权解释) 的和反向的混沌值合并组成虚拟密钥; 54. Combine the truncated (in the right interpretation) and reverse chaotic values in S3 into a virtual key;
55. 明文 (解释) 和所述虚拟密钥进行运算得到密文。 (从权解释合并)55. The plaintext (interpretation) and the virtual key are operated to obtain the ciphertext. (from the right to explain the merger)
2、 一种应用混沌密码流解密的方法, 其特征在于, 包括以下步骤:2. A method for applying chaotic cipher stream decryption, characterized in that it comprises the following steps:
51. 将对称密钥值混沌映射, 以产生混沌值; 51. Chaotic mapping of symmetric key values to generate chaotic values;
52. 将所述混沌值舍位, 并将混沌值反向;  52. Round the chaotic value and reverse the chaotic value;
53. 将所述混沌值合并组成虚拟密钥;  53. Combine the chaotic values into a virtual key;
54. 将密文和所述虚拟密钥进行运算得到明文。  54. The ciphertext and the virtual key are operated to obtain a plaintext.
3、 一种混沌密码流加密的系统, 其特征在于, 包括下述装置:  3. A system for chaotic cipher stream encryption, characterized in that it comprises the following means:
产生对称密钥的随机数字生成装置;  a random number generating device that generates a symmetric key;
用于存储所述随机数字生成装置产生的对称密钥的存储器;  a memory for storing a symmetric key generated by the random number generating device;
将产生的对称密钥值混沌映射, 以产生混沌值的混沌映射装置; 将所述混沌值舍位, 并将部分混沌值反向的转换装置;  a chaotic mapping device that generates a chaotic map of symmetric key values to generate chaotic values; a transforming device that rounds the chaotic values and reverses partial chaotic values;
将所述混沌值合并组成虚拟密钥的密钥生成装置;  Combining the chaotic values into a key generation device that constitutes a virtual key;
将明文和所述虚拟密钥进行运算得到密文的加密装置。  The ciphertext encryption device is obtained by calculating the plaintext and the virtual key.
4、 一种混沌密码流解密的系统, 其特征在于, 包括下述装置:  4. A system for chaotic cryptographic stream decryption, characterized in that it comprises the following means:
将存储器中的对称密钥值进行混沌映射, 以产生混沌值的混沌映射装置; 将所述混沌值舍位, 并将部分混沌值反向的转换装置;  a chaotic mapping device that performs chaotic mapping on a symmetric key value in a memory to generate a chaotic value; a conversion device that rounds the chaotic value and reverses a partial chaotic value;
将所述混沌值合并组成虚拟密钥的密钥生成装置;  Combining the chaotic values into a key generation device that constitutes a virtual key;
将密文和所述虚拟密钥进行运算以得到明文的解密装置。  The ciphertext and the virtual key are operated to obtain a plaintext decryption device.
PCT/CN2008/000040 2007-01-05 2008-01-07 Method and system of encrypt by using chaotic cipher stream WO2008086731A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200710072919.1 2007-01-05
CN 200710072919 CN101216868A (en) 2007-01-05 2007-01-05 A method and system with the application of chaos cipher stream encryption

Publications (1)

Publication Number Publication Date
WO2008086731A1 true WO2008086731A1 (en) 2008-07-24

Family

ID=39623300

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/000040 WO2008086731A1 (en) 2007-01-05 2008-01-07 Method and system of encrypt by using chaotic cipher stream

Country Status (2)

Country Link
CN (1) CN101216868A (en)
WO (1) WO2008086731A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101355417B (en) * 2008-09-10 2011-08-10 重庆大学 Third-order self-governing chaos system
CN102142074B (en) * 2011-03-31 2013-04-10 东北大学 Chaos based universal electronic file encryption and decryption method
CN103346875B (en) * 2013-05-08 2016-10-26 东南大学 The production method of digital chaotic ciphers in chaotic secret communication system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999016208A2 (en) * 1997-09-22 1999-04-01 Qualcomm Incorporated Method and apparatus for generating encryption stream ciphers
CN1480851A (en) * 2002-09-04 2004-03-10 斌 杨 Computer encryption unit and encryption method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999016208A2 (en) * 1997-09-22 1999-04-01 Qualcomm Incorporated Method and apparatus for generating encryption stream ciphers
CN1480851A (en) * 2002-09-04 2004-03-10 斌 杨 Computer encryption unit and encryption method

Also Published As

Publication number Publication date
CN101216868A (en) 2008-07-09

Similar Documents

Publication Publication Date Title
Katz et al. Complete characterization of security notions for probabilistic private-key encryption
JP4575283B2 (en) ENCRYPTION DEVICE, DECRYPTION DEVICE, PROGRAM, AND METHOD
US7190791B2 (en) Method of encryption using multi-key process to create a variable-length key
Alsaidi et al. Compression multi-level crypto stego security of texts utilizing colored email forwarding
JP2008513811A (en) Calculation conversion method and system
WO2000001111A1 (en) Secure data encoder and decoder
JP2002185443A (en) Secret key managing system
Saračević et al. Encryption based on Ballot, Stack permutations and Balanced Parentheses using Catalan-keys
Jakobsson et al. Scramble all, encrypt small
Kazmirchuk et al. The Improvement of digital signature algorithm based on elliptic curve cryptography
WO2008086731A1 (en) Method and system of encrypt by using chaotic cipher stream
Lee et al. Design and evaluation of a block encryption algorithm using dynamic-key mechanism
JP2011040932A (en) Authenticated encryption device, authenticated encryption method, verified decryption device, verified decryption method, encryption system, program, recording medium
Omerasevic et al. CryptoStego—A novel approach for creating cryptographic keys and messages
KR101076747B1 (en) Method and apparatus for random accessible encryption and decryption by using a hierarchical tree structure of stream cipher module
Chen et al. Tame transformation signatures with topsy-turvy hashes
Kumar et al. BEAN: a lightweight stream cipher
Kim et al. A modified exhaustive search on a password system using SHA-1
JP2001509608A (en) Method for cryptographically converting an L-bit input block of digital data into an L-bit output block
Harjito et al. Comparative Analysis between Elgamal and NTRU Algorithms and their implementation of Digital Signature for Electronic Certificate
JP4914377B2 (en) Signature generation apparatus, signature verification apparatus, signature generation verification system, method and program thereof
Alfina et al. Comparative Analysis of Encryption-Decryption Data Use the Symmetrical Key Algorithm of Bit Inserted Carrier (BIC)
KR20020025343A (en) Apparatus and Method for encryption and decryption of file using base key and one-time key
KR101153880B1 (en) Method for key derivation using galois transformation
Maharjan Comparative Study of CAST and TWOFISH algorithm using various Modes of Operations

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 08700600

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 08700600

Country of ref document: EP

Kind code of ref document: A1