WO2008001918A1 - Random number generation device, encryption/decryption device using the same, its program, and program recording medium - Google Patents

Random number generation device, encryption/decryption device using the same, its program, and program recording medium Download PDF

Info

Publication number
WO2008001918A1
WO2008001918A1 PCT/JP2007/063182 JP2007063182W WO2008001918A1 WO 2008001918 A1 WO2008001918 A1 WO 2008001918A1 JP 2007063182 W JP2007063182 W JP 2007063182W WO 2008001918 A1 WO2008001918 A1 WO 2008001918A1
Authority
WO
WIPO (PCT)
Prior art keywords
random number
number table
information
encryption
area
Prior art date
Application number
PCT/JP2007/063182
Other languages
French (fr)
Japanese (ja)
Inventor
Kiyoto Yui
Daisuke Sumisawa
Akira Kawasaki
Takeshi Sasaki
Original Assignee
Kiyoto Yui
Daisuke Sumisawa
Akira Kawasaki
Takeshi Sasaki
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 Kiyoto Yui, Daisuke Sumisawa, Akira Kawasaki, Takeshi Sasaki filed Critical Kiyoto Yui
Publication of WO2008001918A1 publication Critical patent/WO2008001918A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators
    • 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
    • H04L9/0656Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher
    • H04L9/0662Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher with particular pseudorandom sequence generator

Definitions

  • Random number table generator Random number table generator, encryption Z decryption device using the same, program thereof, and program recording medium
  • the present invention relates to a random number table generator and an encryption / decryption device using the same.
  • the present invention relates to a random number table generation device and an encryption Z decryption device that are suitable for embedded devices, home appliances, portable devices, small information terminals, and small game terminal devices that are low in resources.
  • a timer is provided, and a seed is generated based on the time information of the power-on power and the last information of the previous time. Means that can withstand the analysis of objects is disclosed (see Patent Document 1).
  • Non-Patent Document 1 introduces a Mersenne twister.
  • Mersenne twister which uses Mersenne prime numbers, was a pseudorandom number generator developed in 1997 (published in January 1998) by Kei Matsumoto and Takushi Nishimura. It is proved that the period is evenly distributed in the 623-dimensional hypercube with an expressive power of 2 to 19937-1 or 623 words (19937 bits, 2492 bytes).
  • the 32-bit version of Mersenne's twister has an internal structure that increases by one word and has 624 words (19 968 bits, 2496 bytes) of internal variables.
  • a random number table of 624 words (19968 bits, 2496 bytes) is generated by combining these internal variables. This random number table has a different random number table only by the combination of 624 words (19968 bits, 2496 bytes).
  • Non-Patent Document 2 is an introduction page of cryptography published by the Ministry of Foreign Affairs! This page introduces finite and infinite random number cryptography in an easy-to-understand manner. Here, infinite random number cryptography cannot be logically deciphered !, and state the fact! /, (See Non-Patent Document 2).
  • a finite random number expression is a method in which the same random number table is used repeatedly for encryption. It is efficient, but once the random number table is decoded, it can be easily decoded.
  • the infinite random number formula is a method in which the random number table once used is not used again.
  • An infinite random number expression is a cipher that has been proved by information theory that the same random number is not used twice but cannot be deciphered when used only once.
  • Patent Document 1 Japanese Patent Laid-Open No. 2000-242470
  • Patent Document 2 JP 2001-177519 A
  • Patent Document 3 Japanese Patent Laid-Open No. 10-247140
  • Non-patent literature 1 M. Matsumoto and T. Nishimura, Mersenne Twister: A 623- dimensio nally equidistributed uniform pseudorandom number generator ", ACM Trans, on Modeling and Computer Simulation Vol. 8, No. 1, January pp.3- 30 (1998) http://www.math.sci.hiroshima-u.ac.jp/ ⁇ m—mat/MT/mt.html
  • Non-Patent Document 2 Ministry of Foreign Affairs Minister's Secretariat Information and Communication Division, Adjunct Lecturer Sadao Okumura “Vaccinacy and Cryptography” ht tp: // www.mofa.go.jp/ mofaj / annai / snocho / e—seifu / toukou2004.html
  • the present invention enables data to be correctly decrypted only when conditions such as connection of a specific individual, a specific computer system, and specific equipment are satisfied, and data theft, data alteration, viruses and spyware
  • the challenge is to minimize the damage caused by peer-to-peer applications.
  • n encryption keys are set for data, and information can be decrypted when conditions such as connection of a specific individual, a specific computer system, and a specific equipment are satisfied. It is.
  • the present invention provides a random number that overlaps by controlling the pseudo-random number generator with fine-grained control. The strength of the infinite random number formula is taken in such a way that a different random number is generated each time.
  • the random number table generation device of the present invention is a random number table generation device by computer processing, and includes the following elements. That is, a means for generating a random number table having an element number power equal to or greater than the use limit number n (n is a positive number), an area for storing the generated random number table, an area for storing the use limit number n, and elements of the random number table Means to generate another random number table without using the elements after n + 1 of the random number table when using up to the use limit number n. This is the idea corresponding to S916 in FIG.
  • the random number table generating device of the present invention includes means for acquiring a plurality of encryption keys having different origins, an area for storing the plurality of encryption keys having different origins, and the plurality of encryption keys having different origins. Means for generating one random number table as a seed, and an area for storing the random number table.
  • the random number table generating device can generate the random number table by a pseudo random number generation method using Mersenne prime numbers or a pseudo random number generation method by a Mersenne twister.
  • time information may be included as one of the encryption keys.
  • unique information of a device connected to a computer system as a random number table generator can be included.
  • unique information of the computer system itself as the random number table generation device can be included.
  • the serial number of the storage device built in the computer system can be acquired as the unique information of the computer system.
  • the computer system includes embedded devices, home appliances, portable devices, small information terminals, small game terminal devices, and the like.
  • the user's biometric information can be included as one of the encryption keys.
  • a key key input from an input device or automatically set can be included.
  • a means for providing a unique code such as a serial number for each random number table to be generated can be provided.
  • means for generating a new random number sequence by generating a plurality of random number tables and combining the elements of the plurality of random number tables.
  • the encryption Z decryption device of the present invention includes the random number table generation device described above and the following elements. That is, an area for storing information to be encrypted or decrypted, means for encrypting or decrypting information to be encrypted or decrypted using a random table, and information encrypted or decrypted. A storage area.
  • the means for encrypting or decrypting individually generates a random number table with a different seed from the random number table generator for each information to be encrypted or decrypted, and uses the recently generated random number table. Encrypt or decrypt.
  • the time information set in the encryption key can be time information related to information to be encrypted or decrypted.
  • a value indicating a recording unit of a storage device such as a sector and a block
  • the random number table used when encrypting or decrypting the information recorded in a certain recording unit can be provided with means for generating a unique code by giving a value indicating the recording unit.
  • FIG. 18 shows an overall configuration diagram as an electronic device of the computer system of the first embodiment of the present invention.
  • the information processing device includes a central processing unit S1811 (hereinafter referred to as CPU) that executes overall control of the computer and various programs, a memory device S1813 in which various programs and data are loaded, ROMBIOS- S1812, And adapters S1815 and S1816. These are connected to the system bus S1814. [0031] Among these, the host interface S1820 of the HDD S1830 is connected to the adapter S1815. In addition, a reader / writer S1 819 to which a storage device can be attached is connected to the adapter S1816.
  • the USB device S1840 can be mounted as a storage device (storage device). The USB device S1840 has a function as a storage device. In the present embodiment, the USB device S1840 is described as being a memory disk device, but any device may be used as long as the effects of the present embodiment are achieved.
  • ROMBIOS-S1812 includes means for selecting one device from system bootable devices such as HDD-S1830 or a storage device, means for reading the system boot loader from the device module to memory device S1813, and reading And a means for branching to the system boot loader (so-called system boot function).
  • system boot the HDD—S1830 or any storage device power read OS program power is stored in the memory device S1813 and executed by the CPU—S1811.
  • a Mersenne twister is used as a pseudo random number generator. Pseudorandom numbers have a disadvantage that they have a period. Mersenne's twister generates the same random number at regular intervals. Mersenne 'Twister 2-19937-1 The decimal system has a period of about 10 to the 6000th power. In other words, about 10 to the 6000th power of random numbers are repeatedly generated.
  • the upper figure in Fig. 1 shows a straight line of one cycle.
  • the horizontal axis shows the data length, and the divided strips are unit data lengths representing the individual random numbers.
  • S112 is a small table characterized in that the number n of elements does not overlap.
  • the encryption in this embodiment is performed using this small table S112.
  • the small table S112 is not used again. In this way, infinite random number encryption and decryption are performed within the period of the pseudo random number.
  • the small tables S112 are arranged side by side without any gaps! / It is better to be efficient, but there may be gaps!
  • Mersenne's Twister has a 2496-byte (624-word) table internally as its internal specifications, and when the random number generated when one seed is given is 2496 bytes or less, the table is a small table S112 Can be used as In this case, generated in one seed You can generate and manage random numbers under 2496 bytes, and never use the same seed again!
  • n number of tapes
  • S210 is the plaintext that you want to encrypt.
  • S211 is a random number table.
  • the random number table S211 is a collection of small tables S112 generated with different seeds.
  • the result of XORing each element of the plaintext S210 and each element of the small table S211 on a one-to-one basis, that is, in byte units is S212.
  • encryption can be performed by performing an operation between S210 and S211.
  • addition or subtraction may be performed in addition to exclusive OR, but exclusive OR is adopted in this embodiment because the processing is simple.
  • exclusive OR is used, the same exclusive OR is sufficient for decoding, and it is also suitable for computer processing. That is, when it is desired to decrypt the plaintext S210, the plaintext S210 can be decrypted by taking the exclusive OR of the encrypted data S212 and the random number table used at the time of encryption.
  • FIG. 3 shows a physical overview of the system of the present embodiment.
  • S310 is a USB connector of the computer shown in FIG.
  • S311 is a USB memory device (S1840) with a built-in fingerprint authentication device.
  • S1840 USB memory device
  • a prototype was made using a USB memory device with a built-in fingerprint authentication device, but the present invention does not require this fingerprint authentication device. It is clearly indicated that the fingerprint authentication device is one of the embodiments.
  • FIG. 4 explains how to use the USB memory device employed in this embodiment.
  • the basic control software for USB is from Microsoft Corporation.
  • the computer system displays the screen of S410 on the screen of the display device.
  • a CD-ROM device S411 and a removable disk S412 appear on the screen.
  • the computer system displays a screen prompting fingerprint authentication in S416 on the display device.
  • the computer system displays the fingerprint authentication screen of S417 on the display device.
  • the computer system reads the user's fingerprint information and performs fingerprint authentication.
  • fingerprint authentication passes, the computer system switches the screen of S410 to the screen of S413.
  • S414 and S415 displayed after switching the screen are protected disk areas that appear only when fingerprint authentication is performed. In order to perform this series of processing, it is necessary to register the user's fingerprint in the computer system in advance using the tool attached to the USB memory device.
  • FIG. 5 shows n encryption keys that serve as seeds when generating random numbers in the above-described computer system.
  • the encryption key is statically determined. These are essential information for the operation of this device.
  • S510 is a memory area for generating an encryption key.
  • a size of 624 bytes (2496 bytes) is secured. This size is matched to the maximum number of seeds that can be set in the Mersenne Twister Open Program (2002 version (mtl9937ar.c)) used in this example. However, the size of 624 words is secured, but it is not necessary to use all of them.
  • the memory area S510 is assumed to store all zeros once when this memory area is secured. Then, each internal element is stored. Also, whether or not to use all the statically determined elements S511 to S514 in the encryption key stored in the memory area S510 is arbitrary. Store a value in the item to be used, and set the value of the unused item to zero.
  • each element determined statically is an element other than time information and a serial number (dynamic encryption key S610) described later.
  • the keyword S511 is a value stored in the computer system in which this embodiment operates, and is an arbitrary character string.
  • the ASCII character string is 128 bytes or less, and this character string is terminated with a null code.
  • This keyboard S511 sets an initial value via an input screen as shown in S515, and the computer stores it in a nonvolatile storage device.
  • the computer specific information S512 reads and stores the unique code of the computer system or terminal in which this embodiment is operating.
  • the memory area for storing the computer specific information is a 4-byte area.
  • the basic control software of Microphone Software Inc. in the US issues a 4-byte unique code called a volume serial number each time the disk device is initialized.
  • the 4-byte value is written in the memory area S511 as the unique information S512.
  • the 4-byte unique code is shown on the screen of S516.
  • This S516 screen is a collection of disk list information.
  • the S517 hexadecimal code is the 4-byte code.
  • the manufacturer number, product number, and serial number of the USB memory device S311 are registered.
  • a USB device has a manufacturer number, a product number, and a serial number in its original specifications.
  • the combination of these three codes shall be stored. Usually this code is a total of 24 bytes. Allocate a size of 64 bytes to S513 with a margin.
  • the USB manufacturing company number and product number registered in S513 are information written in the USB memory device at the time of manufacture. This is a safety measure to prevent the manufacturer company number and product number from being stored when a USB from a different company is connected.
  • USB memory device S311 when the USB memory device S311 is connected, it is read from the USB memory device and classified as S513. Shall be paid.
  • a 4-byte biometric key is registered in S514. This reads the volume serial number of S415 in Fig. 4 that appears as a result of biometric authentication.
  • biometric authentication key it is preferable to read the biometric authentication key directly.
  • fingerprint authentication it is conceivable that multiple persons including the administrator register the fingerprint. In this case, different biometric data appears for each person who performed fingerprint registration.
  • fingerprint authentication it is necessary to share the encryption key. Therefore, if the biometric key is used for encryption as it is, sharing will be lost and inconvenience will occur. Therefore, it is necessary to key S415 in this way.
  • biometric authentication code a code appearing as a result of biometric authentication is registered as a biometric authentication code.
  • S610 indicates a dynamic encryption key area.
  • the generation of n dynamic encryption keys stored in the dynamic encryption key area S610 will be described with reference to FIG. Figure 6 shows the memory map of the dynamic encryption key area S610!
  • S611 is a time information area, which is an 8-byte memory area. This stores the time information of the computer system.
  • the time information specification is based on the power of the basic control software installed in the computer, usually with system seconds shown in 4 to 8 bytes, and the current year / month / day / hour / minute / second can be determined uniquely.
  • a common system second is the number of seconds from 00:00:00 on January 1, 1970 to the present, in seconds. It is convenient to express the date and time up to 2100 because it has a range of about 130 years with 4 bytes of expressive power.
  • time information area S611 when performing encryption, the current time at that time is stored. In addition, since this time information is necessary for decryption, when the encrypted data is stored in the storage device, the time information used for the encryption key is always stored in association with it. This time information storage process is the role of the higher-level process that calls this conversion program (encryption key Z decryption key program), and specifies that it does not belong to this conversion program. Also, as described above, the encrypted data cannot be decrypted without this time information. Therefore, when performing encryption key and decryption key as a set, it is clearly stated that the higher-level program check device must always store the time information. [0062] In the time information area S611, when decryption is performed, the time when encryption is performed is stored. Time information always exists for each piece of data encrypted by a higher-level program. The time information is registered here.
  • serial number area S612 a serial number starting from zero is stored in the serial number area S612.
  • S613 indicates data to be encrypted or decrypted.
  • the horizontal axis is the data length, which has N elements.
  • S614 indicates a division in units of RND_SIZE bytes. In this embodiment, consecutive numbers are assigned in units of RND_SIZE bytes.
  • the first RND_SIZE of S613 is zero
  • the next RND_SIZE is 1
  • the number is incremented by one. That is, when the data to be encrypted or decrypted S613 is given, the number obtained in S614 is stored in the serial number area S612.
  • the sequence number area S612 has a 4-byte area.
  • RND_SIZE indicates 2048 bytes.
  • RND_SIZE can be of any size, but it is preferable to fit within the width of the random number table guaranteed by the pseudo-random numbers used.
  • a Mersenne twister is used, and the safe width of this is 2496 bytes. This width should be chosen according to the characteristics of the pseudorandom number generator used.
  • S620 is a free area.
  • the entire area S510 shown in FIG. 5 has 624 words (2496 bytes) secured, and the remaining static information keys S511 to S514 and the time information area S611 and sequence number area S612 which are dynamic encryption keys are allocated.
  • the area is a free area S620.
  • the time information S611 and the serial number S612 are repeatedly stored in this empty area S620.
  • the present invention operates without any problem even if the empty area S620 is cleared to zero.
  • setting the value in the free area S620 as described above is a device for disturbing the value taken by the memory area S510 as much as possible and generating a higher-quality random number.
  • FIG. 7 shows the concept of encryption / decryption actually performed.
  • S710 indicates data to be encrypted or decrypted. This data shall have a length of N bytes (corresponding to the case where the unit data length is 1 byte in Figs. 1 and 2).
  • S711 is a random number with the size of RND_SIZE generated using the data in memory area S510 shown in FIG. 5 as a seed. It is a table (corresponding to the small table S112 in FIGS. 1 and 2). Each random number table S711 is generated as a different random number table because the serial number stored in S612 in FIG. 6 changes according to the position from the beginning.
  • S712 shows the result of exclusive OR of the data S710 to be encrypted or decrypted and each random number table S711.
  • S710 is plaintext
  • the encrypted result is S71
  • FIG. 8 shows input / output of a program that realizes the encryption / decryption device of the present embodiment.
  • a memory area for storing an address reference variable is defined.
  • the memory area for storing the address reference variable stores a position for referring to the memory area to be mounted on the computer system and the portable terminal, and changes depending on the computer system.
  • an address reference variable is synonymous with a pointer variable, pointer variable, or address variable.
  • S810 is a memory area for storing address reference variables. As the contents, the memory address where the memory area S510 shown in FIG. 5 exists is stored.
  • S811 is a memory area for storing an address reference variable. The contents are encrypted or decrypted, and the memory address where the data stored in S814 is stored.
  • S814 is a table storing data to be encrypted or decrypted.
  • this program is a component that performs encryption / decryption, and actually, there is a higher-order program that uses the program.
  • the host program has an overview of the data represented by S817 when converting.
  • S814 is an arbitrary mapping of S817.
  • the upper program stores and stores the converted! /, Location of S817 in the form of a table in memory, and stores this memory address in S811.
  • S815 is position information indicating where the data stored in S814 starts in S817. Zero at the beginning. 100 for the 100th byte.
  • S816 is information indicating how many bytes the data stored in S814 is.
  • S812 is an 8-byte memory area. Stores S815 as the contents. In S812, 4 bytes is usually sufficient for 32-bit basic control software. In this program, 8 bytes are provided with a margin. If the S817 is simply a file or small data in memory, 4 bytes is sufficient. On the other hand, the entire hard disk may be converted. In this case, the total data to be converted is several tens of gigabytes. Considering such a case, it is 8 bytes.
  • S813 is a 4-byte memory area. Stores S816 as the contents.
  • FIG. 9 shows a control flow of the present embodiment.
  • Figure 8 shows the actual flow of the program that defines input and output.
  • initialization processing is performed!
  • a variable no having a size of 4 bytes
  • a variable ip having a size of 4 bytes
  • an array variable rncLtbl having a size of RND_SIZE are allocated.
  • the contents of no, ip and rnd_tbl do not need to be initialized! /.
  • S912 calculates the remainder of S812 and substitutes it into ip.
  • the serial number is stored in S612 here.
  • the address of the serial number area S612 can be calculated from the memory address strength of S510 stored in S810.
  • a random number table is generated by a Mersenne twister. Specifically, the processes shown in FIGS. 10 and 11 described later are executed.
  • the S810 value is stored in S1010, which will be described later, and the start address on the memory of rncLtbl is stored in S1 011. And the processing of Fig. 10 and Fig. 11 Do.
  • S915 is a loop.
  • S916 is a restrictor.
  • ip indicates the reference position of the random number table rnd_tbl currently used. When ip takes a value less than RND_SIZE, it correctly refers to the random number table. On the other hand, when ip exceeds RND_SIZE, it is when the random number table is used and cut.
  • S920 substitutes zero for ip. When generating a new random number, the ip indicating the starting position is cleared.
  • FIG. 10 shows input / output of the random number generation program.
  • S1010 is a memory area for storing address reference variables.
  • the memory address where S510 exists is stored as its contents.
  • S1011 is a memory area for storing address reference variables. The contents store the memory address where the random number table exists. This random number table is rnt_tbl shown in FIG. S9
  • This memory area has the size of RND_SIZE allocated in 10.
  • FIG. 11 shows the processing of the random number generation program.
  • S1111 a random number seed is given.
  • the standard function init_by_array () published by Mersenne 'Twister is executed.
  • S510 is given as a seed to this function.
  • the function is called by specifying the address and length of the memory area that stores the key data for seed generation.
  • the start address of S510 and the length of the area are given.
  • S1113 assigns the value of S1011 to the variable ptr.
  • S1115 generates a random number.
  • Mersenne 'Twister public function genrand_int32 () is executed.
  • the return value of this function is a 4-byte random number. This 4-byte random number is assigned to the address area indicated by ptr. Store a 4-byte random number at a time.
  • S1116 is an optional black box process. This processing is not necessary. If the random number generated by Mersenne 'Twister is adopted as it is, it is not preferable as a random number for encryption because the algorithm is publicly available. In order to correct this, it is preferable to apply arbitrary deformation. The transformation process is performed in S1116. It works without problems even without S1116. However, the reliability can be improved by incorporating it.
  • variable ptr is increased.
  • the memory address indicated by ptr is added by 4 bytes.
  • the variable ptr is an address type variable that references 4 bytes. Therefore, increasing the indicated value by one indicates the next 4-byte area, and actually increases the memory address by four. It is added here that it is 1 addition on the notation but 4 addition in byte conversion.
  • FIG. 12 describes the flow of a program for acquiring a unique code of a specific device.
  • This embodiment is an apparatus that performs encryption / decryption. It is acquired by a program or a host device and stored in S513 in FIG.
  • a program in which a higher-level program implemented for prototyping acquires a unique code.
  • a unique code can be obtained, and its mechanism is shown.
  • recognition of a USB memory device with a built-in fingerprint authentication function as a unique device and identification of the unique code are performed.
  • S1220 is a table showing the manufacturer code, product number, and serial number of the USB device. Hexadecimal A 4-byte code that identifies the manufacturer. Similarly, it has a 4-byte hexadecimal product number. And it has a 16-byte serial number. In this prototype, the serial number has a margin of 54 bytes, giving a total of 64 bytes.
  • S1221 represents the company number, serial number, and product number with reference to a character string registered in the registry of 32-bit basic common software of Microsoft Corporation. Different ways of expression depending on the basic common software. Each code is converted to an ASCII character string and concatenated into a single character string for management. In this way, the basic common software is now connected! /, So that the unique code of the USB device can be obtained! /, (The registry is the basic common software built in for management. Database).
  • S1210 performs initialization. When this program ends, the value passed to the calling upper program is cleared to zero.
  • S1211 is an endless loop.
  • S1212 obtains the unique code of the currently connected USB device from the basic common software. In this prototype, the first connected device is acquired for the first time. Loop and get the second connected device for the second time. If this is repeated and all of the connected devices are acquired, the acquisition fails.
  • the presence / absence of the connected device S311 is determined. If none, exit the program. At this time, the zero-cleared memory area set in S1210 is stored in the upper program as a return value.
  • the company number of the value such as S1221 obtained from the connected device S311 is determined. At this time, it is determined whether it matches the manufacturing company code written in this program beforehand.
  • the manufacturer code to be included in the program is this program.
  • the code of the company specified or the corresponding company shall be embedded when manufacturing and selling.
  • the manufacturing company codes match, in S1215, the obtained product number as in S1221 is determined. At this time, it is determined whether or not it matches the product number code written in this program in advance.
  • the product number code to be incorporated into the program shall be genuinely designated or embedded with the corresponding company code when this program is manufactured and sold.
  • the unique code of the connected device S311 is registered in the connected device information area S513 of FIG. 5, and the encryption key using the connected device S311 of this embodiment is used.
  • an encryption key composed of a static encryption key and a dynamic encryption key is stored in the memory area S510 shown in FIG.
  • the seed generated is input to the Mersenne Twister to generate a random number table.
  • the random number table is generated as different random number tables 0 to n as shown in FIG. 7 by including the serial number S612 in the encryption key.
  • the encryption result or the decryption result S712 is obtained by taking the exclusive OR of the data S 710 to be encrypted or decrypted and each random number table S711. .
  • the computer processing is performed by the firmware shown in FIG. 18 and FIG. 3, and the processing content is performed by using the memory area and the program processing described in FIG. 8 to FIG.
  • all computer processing is realized by a computer executing a program.
  • Data used for computer processing is read from the storage device by the computer as necessary, and stored in the storage device as necessary.
  • Instruction to the user force computer is performed by operating the input device, and information output to the computer force computer is performed by an output device such as a display device. The same applies to the embodiments described later.
  • S1310, S1311, and S1312 are RND_SIZE random number tables. This random number table can be of any size, but is RND_SIZE here because it is easy to manage.
  • the number of three prepared is originally n and may be arbitrary. However, 3 is calculated as a realistic number from the size of RND_SIZE. Now, it is assumed that different random number tables are stored in S1310, S1311, and S1312, respectively.
  • S1313 is arbitrary data to be converted.
  • S1319 is data resulting from the conversion.
  • S1314 is a random number table having the size of RND_SIZE generated by taking the exclusive OR of S1310, S1311, and S1312.
  • the first 1 byte of S1314 is the result of XORing the first 1 byte of S1310, S1311, and S1312.
  • Each element of S1314 is the result of XORing the elements at the same positions of S1310, S1 311, and S1312.
  • S1315 is a random number table generated in the same process as S1314. However, S1 311 is generated by rotating 1 byte before generation. This rotation can be either clockwise or counterclockwise. Here, it is assumed that it is rotated 1 byte counterclockwise.
  • S1316 and S1317 are generated after rotating S1311 one byte at a time in the same manner.
  • S1311 When generating random numbers in this way, S1311 will circulate and generate the same random number after repeating RND.SIZE times. At this time, S1312 is rotated 1 byte counterclockwise. In this way, long-period random numbers can be generated by combining n random number tables.
  • the random number tables 0 to n are generated while shifting the combinations of the values of the tables S1310, S1311, and S1312. If the data to be converted is generated individually, 8GB is enough.
  • Random number tables S1310, S1311, and S1312 are most preferably able to generate a random number table for each of S1319. However, it is possible to generate high-quality random numbers by generating S1311 and S1312 in advance and generating only S1310 for each S1319.
  • the present embodiment provides a program and apparatus for performing encryption / decryption using this method.
  • FIG. 14 shows input / output of a program that implements the encryption / decryption device of the present embodiment.
  • encryption and decryption are performed in the same way, and hence simply referred to as conversion.
  • the memory area for storing the address reference variable is a thing for storing a position for referring to the memory area to be mounted on the computer system and the portable terminal, and changes depending on the computer system. Since this embodiment was prototyped with 32-bit basic control software of Microsoft Corporation, the memory area for storing address reference variables is 4 bytes.
  • S1413 is a memory area for storing an address reference variable. In this area, the memory address where the data S814 exists, which is encrypted or decrypted, is stored.
  • the data S817 to be encrypted or decrypted, the S814 that is the part, the position S815 from the head where the S814 exists in the data S817, and the length S816 of the S814 are as follows: This is the same as that shown in FIG. Therefore, the same reference numerals are given and redundant description is omitted.
  • S1414 is an 8-byte memory area.
  • S815 is stored in this area. In this area, 4 bytes is usually sufficient for 32-bit basic control software. This program has a margin of 8 bytes. If the S817 is simply a file or small data in memory, 4 bytes is sufficient. However, the entire hard disk may be converted. In this case, the entire data to be converted is several tens of gigabytes. Considering such a case, it is 8 bytes.
  • S1415 is a 4-byte memory area. S816 is stored in this area.
  • S1416 is a random number table having a size of RND_TBL. This corresponds to S1310 in FIG. In this case, the stored data is generated by the program shown in FIGS. 10 and 11 described in the first embodiment.
  • S1417 is a random number table having a size of RND_TBL. This corresponds to S1311 in FIG. In this case, the stored data is generated by the program shown in FIGS. 10 and 11 described in the first embodiment.
  • S1418 is a random number table having a size of RND_TBL. This corresponds to S1312 in FIG. In this case, the stored data is generated by the program shown in FIGS. 10 and 11 described in the first embodiment.
  • S1410 is a memory area for storing address reference variables.
  • the content is S1416 Stores the existing memory address.
  • S1411 is a memory area for storing address reference variables. The contents store the address on the memory where S1417 exists.
  • S1412 is a memory area for storing an address reference variable. The content stores the address on the memory where S1418 exists.
  • FIG. 15 shows the flow of control of the present embodiment. This is the actual flow of a program that defines input and output according to Fig. 14.
  • ipl manages the random number table indicated by S1416.
  • ip2 manages the random table indicated by S1417.
  • ip3 manages the random number table indicated by S1418.
  • S1511 substitutes the position used at the beginning of the random number table shown in S1416 for calculation Upl.
  • the random number in S1511 uses a buffer of size RND_SIZE. Therefore, the result of taking the remainder with RND_SIZE is the first use starting point.
  • S1512 substitutes the position used at the beginning of the random number table shown in S1417 for calculation Up2.
  • S1512 circulates S1416 once to circulate 1 byte. Therefore, S1314 is calculated by dividing by RND_SIZE.
  • S1513 substitutes the position used at the beginning of the random number table indicated by S1418 for calculation Up3.
  • S1513 circulates 1 byte as S1417 circulates once. Therefore, ip2 is divided and calculated by RND_SIZE.
  • S1517 performs loop processing. Loops through the value stored in S1415.
  • conversion information is generated from three random number tables. Specifically, in S1518, the exclusive logical ring of the value having the element number as the value indicated by ipl on S1416 and the value having the element number as the value indicated by ip2 on S1417 is stored in wk. In S1519, an exclusive logical ring of wk and a value having the value indicated by ip 3 as an element number on S1418 is taken and stored in wk.
  • S1525 is a process to be performed when the stored value of ipl is equal to or larger than RND_SIZE. This determination is processing when the number of elements in the random number table S1416 is exceeded. ipl is set to zero, and the use of random number table S1416 is returned to the beginning.
  • a random number table used for encryption is generated by combining three previously generated random number tables. For this reason, a random number table can be generated by a simple memory operation. As a result, a random number table with high randomness can be obtained at high speed.
  • Example 3 to be described next is a simple application program that performs encryption Z decryption.
  • Encryption Z decryption processing itself uses the processing described in the first embodiment.
  • FIG. 16 describes the processing flow of this embodiment.
  • This embodiment is executed from the basic control software, and designates a file to be converted (encrypted or decrypted). Read the file you want to convert, execute the conversion, and save the conversion result as a file in the storage device. Once it is applied to the application shown in this embodiment, encryption is performed. When the generated result is applied again to this application, decryption is performed.
  • S1610 performs initialization.
  • the 4-byte variables ip, no, and i are reserved.
  • the memory area used as S510 in Fig. 5 is secured.
  • dat_tbl is the size of RND_SIZE.
  • S1611 assigns zero to the variable ip.
  • the file name of the conversion source is input. This is an interactive question about the file name path on the disk.
  • the file specified here is the target of conversion.
  • the conversion destination file name is opened in the binary write mode.
  • the file name at the time of opening is the one obtained by adding the character string “.enc” to the end of the file name acquired in S1613, and is saved in the same path as the S1613 conversion source file.
  • terminal information is acquired. Specifically, it is assumed that the specific information of the computer system on which this embodiment operates is acquired. Here, it is assumed that the HDD volume serial number S517 is stored in the computer-specific information area S512 shown in FIG.
  • the creation time of the conversion source file acquired in S1613 is acquired.
  • Tate time is the time information when the file was created. This time information is stored in the time information area S611 in FIG.
  • the create time is used here, but the write time, that is, the last write time may be used. The important thing is to unify the time information used as the encryption key. In this embodiment, the creation time is unified.
  • S1620 is an endless loop that configures i as a counter. The initial value of i is set to zero, and the value of i is incremented by 1 for each loop. [0181] In S1621, the conversion source file is read sequentially in the binary mode by the size of RND_SIZE. The read data is stored in daUbl. The remaining amount of data in the file is less than RND_SIZE! / Sometimes, only the amount that exists is read.
  • S1625 the conversion program described in FIGS. 8 and 9 is executed.
  • S810 is assumed to store the memory start address where S510 storing the seed information exists.
  • S1627 the value of no is added to the value of ip in preparation for the next loop.
  • time information is set in the conversion destination file. This time information is the time information acquired in S1619. This time information is written as the create time for the conversion destination file.
  • decoding can be performed the next time the conversion destination file is called in the present embodiment.
  • encryption or decryption can be easily performed by file processing.
  • This embodiment which will be subsequently introduced, is also a simple application program for performing encryption key or decryption key.
  • the encryption / decryption process itself uses an encryption device and a decryption device that execute the program of the second embodiment.
  • FIG. 17 describes the processing flow of this embodiment. This embodiment is executed from the basic control software and designates a file to be converted. Read the file you want to convert, convert it, and save the conversion result as a file in the storage device. When it is applied once to the application shown in this embodiment, encryption is performed. When the generated result is applied to this application again, it is decrypted.
  • S1710 performs initialization.
  • the 4-byte variables ip, no, and i are reserved.
  • the memory area used as S510 is secured.
  • secure dat_tbl as a working memory area for reading and writing files.
  • daUbl is the size of RND_SIZE.
  • rnd_tbl I, rnd_tbl2, and rnd_tbl3 are secured as array variables for storing the random number table. All three sizes are RND_SIZE.
  • the file name of the conversion source is input. This asks the executor of the application interactively about the path and file name on the disk.
  • the file specified here is the target of conversion. Also, the creation time (time information) of the file specified here is acquired and stored.
  • the conversion destination file name is opened in the binary write mode.
  • the file name at the time of opening is the same as the conversion source file specified in S1713, with the character string ".enc" added to the end of the file name acquired in S1713. Shall.
  • terminal information is acquired. Specifically, it is assumed that the specific information of the computer system on which this embodiment operates is acquired. Here, it is assumed that the HDD volume serial number S517 is stored in the computer specific information area S512.
  • a random number table is stored in rnd_tbll. Random numbers are generated by executing the programs in Fig. 10 and Fig. 11, and stored in rnd_tbll. That is, the memory address where S510 exists is stored in S1010 of FIG. In S1011, the memory address where rnd_tbll exists is stored. Then, execute the program in Fig. 11 to obtain a random number table in rnd_tbll.
  • a random number table is stored in rnd_tbl2. Generates random numbers by executing the programs in Fig. 10 and Fig. 11 and stores them in rnd_tbl2. That is, the memory address where S510 exists is stored in S1010 of FIG. In addition, the memory address where rnd_tbl2 exists is stored in S1011. Then execute the program in Fig. 11 to obtain a random number table in rnd_tbl2.
  • the creation time of the file acquired in S1713 is acquired.
  • Create time is the time information when the file was created. This time information is stored in the time information area S611.
  • the create time is used here, but the write time, that is, the last write time may be used. The important thing is to unify the time information used as the encryption key. In this embodiment, the creation time is unified.
  • Unused areas shall have a value of zero.
  • a random number table is stored in rnd_tbl3.
  • a random number is generated by executing the programs in Fig. 10 and Fig. 11, and stored in rnd_tbl3. That is, the memory address where S510 exists is stored in S1010 of FIG. Store the memory address where rnd_tbl3 exists in S1011. Then, execute the program in Fig. 11 to obtain a random number table in rnd_tbl3.
  • S1722 is a permanent loop that configures i as a counter.
  • the initial value of i is set to zero, and the value of i is incremented by 1 for each loop.
  • the conversion source file is read sequentially in the binary mode by the size of RND_SIZE.
  • the read data is stored in daUbl.
  • the remaining amount of data in the file is less than RND_SIZE! / Sometimes, only the amount that exists is read.
  • time information is set in the conversion destination file.
  • This time information is the time information acquired in S1713.
  • this time information is written as the create time for the conversion destination file. By setting this time information, decoding can be performed the next time the conversion destination file is called in this embodiment.
  • the random number generated in the first embodiment is further influenced by time information, disturbing the random number table, and eliminating the possibility of duplication between the generated random number tables. It is.
  • the Mersenne Twister which is a random number generator premised on the first embodiment, has an internal memory of 624 words (one word is 4 bytes). If the code is different, it is guaranteed that at least one word out of 624 words (2496 bytes) belonging to the seed will generate a different random number table. In other words, it is guaranteed that a different random number table is generated in units of 2496 bytes. Conversely, in small tables below 2496, the same random number table may appear partially.
  • FIG. 19 shows the mechanism realized by a program.
  • FIG. 19 shows the extracted S1116 process (arbitrary black box process) described in FIG.
  • the present embodiment is realized by incorporating the program of FIG. 19 into S1116 of the first embodiment.
  • S1910 checks the remainder of 3 of the value indicated by the loop counter i! /. If the remainder is zero, the process branches to S1911. If the remainder is 1, the process branches to S1912. If the remainder is 2, the process branches to S1913.
  • FIG. 1 An explanatory diagram showing a period of a pseudo-random number.
  • FIG. 2 is an explanatory diagram showing data encryption.
  • FIG. 3 is a diagram showing a physical overview of the example.
  • FIG. 4 is a diagram illustrating a fingerprint authentication storage device.
  • FIG. 5 is a diagram illustrating n statically determined encryption keys.
  • FIG. 6 is a diagram illustrating a dynamic encryption key.
  • FIG. 7 is a diagram for explaining the concept of actual encryption / decryption.
  • FIG. 8 is a diagram for explaining the input / output of the encryption / decryption device and the function f. (Example 1)
  • FIG. 9 is a diagram for explaining processing of a conversion program. (Example 1)
  • FIG. 10 is an explanatory diagram showing input / output of a random number table generation program. (Example 1)
  • FIG. 11 is an explanatory diagram showing a random number table generation program. (Example 1)
  • FIG. 12 is an explanatory diagram of a program for acquiring a unique code of a unique device.
  • FIG. 13 is an explanatory diagram showing synthesis of a random number table using n random number tables.
  • FIG. 14 is an explanatory diagram showing input / output of the encryption key decryption program. (Example 2)
  • FIG. 15 is an explanatory diagram showing the flow of a conversion program. (Example 2)
  • FIG. 16 is an explanatory diagram showing a conversion application. (Example 3)
  • FIG. 17 is an explanatory diagram showing a conversion application. (Example 4)
  • FIG. 18 is an explanatory diagram showing a device as a host.
  • FIG. 19 is an explanatory diagram showing an example of S1116 processing. (Example 5)
  • S1811 Central processing unit (CPU).

Abstract

[PROBLEMS] The necessity of sophisticated encryption and decryption which can easily be used for a memory disc or the like is increasing. The present invention generates an effective pseudo-random number which can be used in a small-scale computer system and a mobile terminal. A pseudo-random number generation device has n encryption keys and uses a combination of the encryption keys so as to extract the maximum performance of the pseudo-random number and execute encryption and decryption for a rugged memory disc. [MEANS FOR SOLVING PROBLEMS] Since a random number sequence generated by a reproducible pseudo-random number has an N-1 cycle, a mechanism has been developed for using the generated random number sequence in this cycle without entering the next cycle. Moreover, the random number generation device includes a mechanism for extracting a random number sequence without overlap in the random number sequence N-1 generated by the pseudo-random number so as to maximize the disorder of the random number and extract the maximum performance of the random number generation device. The random number generation device is embedded to encrypt/decrypt data so as to protect data in a memory disc or the like.

Description

明 細 書  Specification
乱数表発生装置及びこれを利用した暗号化 Z復号化装置並びにそのプ ログラム及びプログラム記録媒体  Random number table generator, encryption Z decryption device using the same, program thereof, and program recording medium
技術分野  Technical field
[oooi] 本発明は、乱数表発生装置及びこれを利用した暗号化 Z復号化装置に関するも のである。特に、少リソースな、組込機器、家電品、携帯機器、小型情報端末、小型 ゲーム端末機器に好適な乱数表発生装置及び暗号化 Z復号化装置に関するもの である。  [oooi] The present invention relates to a random number table generator and an encryption / decryption device using the same. In particular, the present invention relates to a random number table generation device and an encryption Z decryption device that are suitable for embedded devices, home appliances, portable devices, small information terminals, and small game terminal devices that are low in resources.
背景技術  Background art
[0002] 一般的な乱数生成の技術として、タイマーを備え、電源起動力 の時間情報と、前 回の最終情報とに基づいてシードを生成し、このシードによって乱数生成を行うこと で、外部力もの解析にも耐える手段が開示されている (特許文献 1参照)。  [0002] As a general random number generation technique, a timer is provided, and a seed is generated based on the time information of the power-on power and the last information of the previous time. Means that can withstand the analysis of objects is disclosed (see Patent Document 1).
[0003] また、直近の乱数のやり取りを覚えておき、使った乱数値を使わないようにすること で、認証の安全性を高めようとする方法が開示されている (特許文献 2参照)。  [0003] In addition, a method is disclosed in which the security of authentication is improved by remembering the most recent exchange of random numbers and not using the used random number values (see Patent Document 2).
[0004] また、少ないリソースで乱数生成を実現しょうとするもので、自装置内で乱数生成す る手段が開示されている (特許文献 3参照)。  [0004] Further, there is disclosed means for generating a random number within its own device in order to realize random number generation with a small number of resources (see Patent Document 3).
[0005] また、非特許文献 1には、メルセンヌ ·ツイスタが紹介されている。メルセンヌ素数を 利用したメルセンヌ 'ツイスタ (Mersenne twister)は、 1997年(論文発表は 1998年 1月) に松本眞と西村拓士によって開発された擬似乱数生成器である。周期が 2の 19937 乗- 1つまり 623ワード(19937ビット、 2492バイト)の表現力で、 623次元超立方体の中 に均等に分布することが証明されている。  [0005] Non-Patent Document 1 introduces a Mersenne twister. Mersenne twister, which uses Mersenne prime numbers, was a pseudorandom number generator developed in 1997 (published in January 1998) by Kei Matsumoto and Takushi Nishimura. It is proved that the period is evenly distributed in the 623-dimensional hypercube with an expressive power of 2 to 19937-1 or 623 words (19937 bits, 2492 bytes).
[0006] 32ビット版のメルセンヌ 'ツイスタは、内部構造として 1ワード増やし、 624ワード(19 968ビット、 2496バイト)の内部変数を持つ。この内部変数の組み合わせで 624ワード (19968ビット、 2496バイト)の乱数表を生成する。この乱数表は、内部の 624ワード(1 9968ビット、 2496バイト)の組み合わせだけ異なる乱数表が存在する。  [0006] The 32-bit version of Mersenne's twister has an internal structure that increases by one word and has 624 words (19 968 bits, 2496 bytes) of internal variables. A random number table of 624 words (19968 bits, 2496 bytes) is generated by combining these internal variables. This random number table has a different random number table only by the combination of 624 words (19968 bits, 2496 bytes).
[0007] 以上より、均等に分布することを証明された最低でも 624ワード(19968ビット、 2496 ノ《イト)の乱数表が 2の 19937乗- 1の個数が存在すると説明できる (非特許文献 1参照 ) o [0007] Based on the above, it can be explained that there are at least 624 words (19968 bits, 2496 bits) with a random number table of 2 to the power of 19937-1 proven to be evenly distributed (Non-patent Document 1) reference ) o
[0008] また、非特許文献 2は、外務省が公開して!/、る暗号の紹介ページである。このぺー ジでは、有限乱数式および無限乱数式暗号を判りやすく紹介している。ここでは無限 乱数式暗号は論理的に解読できな!、と!、う事実を述べて!/、る (非特許文献 2参照)。  [0008] Further, Non-Patent Document 2 is an introduction page of cryptography published by the Ministry of Foreign Affairs! This page introduces finite and infinite random number cryptography in an easy-to-understand manner. Here, infinite random number cryptography cannot be logically deciphered !, and state the fact! /, (See Non-Patent Document 2).
[0009] データの暗号ィ匕においては、有限乱数式と無限乱数式が存在する。有限乱数式と は同じ乱数表を繰り返し暗号ィ匕に使用する方式である。効率が良 、反面一度乱数表 を解読されると後は簡単に解読ができる。無限乱数式は一度使用した乱数表は 2度 と使わないという方式である。無限乱数式は同じ乱数を 2度使わず 1度限りの使用に おいては絶対に解読できないことが情報理論により証明されている暗号である。 特許文献 1:特開 2000— 242470号公報  [0009] In data encryption, there are a finite random number expression and an infinite random number expression. A finite random number expression is a method in which the same random number table is used repeatedly for encryption. It is efficient, but once the random number table is decoded, it can be easily decoded. The infinite random number formula is a method in which the random number table once used is not used again. An infinite random number expression is a cipher that has been proved by information theory that the same random number is not used twice but cannot be deciphered when used only once. Patent Document 1: Japanese Patent Laid-Open No. 2000-242470
特許文献 2 :特開 2001—177519号公報  Patent Document 2: JP 2001-177519 A
特許文献 3:特開平 10— 247140号公報  Patent Document 3: Japanese Patent Laid-Open No. 10-247140
非特干文献 1 :M. Matsumoto and T. Nishimura, Mersenne Twister: A 623- dimensio nally equidistributed uniform pseudorandom number generator", ACM Trans, on Mo deling and Computer Simulation Vol. 8, No. 1, January pp.3- 30 (1998)http://www.m ath.sci. hiroshima-u . ac . jp/〜m— mat/MT/ mt . html  Non-patent literature 1: M. Matsumoto and T. Nishimura, Mersenne Twister: A 623- dimensio nally equidistributed uniform pseudorandom number generator ", ACM Trans, on Modeling and Computer Simulation Vol. 8, No. 1, January pp.3- 30 (1998) http://www.math.sci.hiroshima-u.ac.jp/~m—mat/MT/mt.html
非特許文献 2 :外務省大臣官房情報通信課 非常勤講師 奥村定夫「外交と暗号」 ht tp: // www.mofa.go.jp/ mofaj/ annai/ snocho/ e— seifu/ toukou2004.html  Non-Patent Document 2: Ministry of Foreign Affairs Minister's Secretariat Information and Communication Division, Adjunct Lecturer Sadao Okumura “Diplomacy and Cryptography” ht tp: // www.mofa.go.jp/ mofaj / annai / snocho / e—seifu / toukou2004.html
発明の開示  Disclosure of the invention
発明が解決しょうとする課題  Problems to be solved by the invention
[0010] 当発明は、特定個人、特定のコンピュータシステム、特定の機材の接続等の条件を 満たした時だけデータを正しく復号ィ匕できるようにして、データ盗難 ·データ改ざん ·ゥ ィルスやスパイウェア'ピアツーピアによるアプリケーション力もなる被害を最小にする ことを課題とする。  [0010] The present invention enables data to be correctly decrypted only when conditions such as connection of a specific individual, a specific computer system, and specific equipment are satisfied, and data theft, data alteration, viruses and spyware The challenge is to minimize the damage caused by peer-to-peer applications.
課題を解決するための手段  Means for solving the problem
[0011] 当発明は、データに対して n個の暗号鍵を設定し、特定個人、特定のコンピュータ システム、特定の機材の接続等の条件を満たした時に情報を復号ィ匕できるようにする ものである。また、本発明は、疑似乱数の発生装置をきめ細力べ制御し重複する乱数 の発生を防ぎ、毎回異なる乱数を生成するようにして無限乱数式の強度を取り入れ たものである。 [0011] In the present invention, n encryption keys are set for data, and information can be decrypted when conditions such as connection of a specific individual, a specific computer system, and a specific equipment are satisfied. It is. In addition, the present invention provides a random number that overlaps by controlling the pseudo-random number generator with fine-grained control. The strength of the infinite random number formula is taken in such a way that a different random number is generated each time.
[0012] 本発明の乱数表発生装置は、コンピュータ処理による乱数表発生装置であり、以 下の要素を備える。即ち、使用制限数 n(nは正数)以上の要素数力もなる乱数表を 生成する手段と、生成した乱数表を記憶する領域と、使用制限数 nを記憶する領域と 、乱数表の要素を使用制限数 nまで使用したとき当該乱数表の n+ 1以降の要素を 使用せずに別の乱数表を生成させる手段とを備える。これは、後述する実施例のうち 図 9の S916に対応する思想である。  [0012] The random number table generation device of the present invention is a random number table generation device by computer processing, and includes the following elements. That is, a means for generating a random number table having an element number power equal to or greater than the use limit number n (n is a positive number), an area for storing the generated random number table, an area for storing the use limit number n, and elements of the random number table Means to generate another random number table without using the elements after n + 1 of the random number table when using up to the use limit number n. This is the idea corresponding to S916 in FIG.
[0013] また、本発明の乱数表発生装置は、起源の異なる複数の暗号鍵を取得する手段と 、前記起源の異なる複数の暗号鍵を記憶する領域と、前記起源の異なる複数の暗号 鍵をシードとして一つの乱数表を生成する手段と、前記乱数表を記憶する領域とを 備える。  [0013] Further, the random number table generating device of the present invention includes means for acquiring a plurality of encryption keys having different origins, an area for storing the plurality of encryption keys having different origins, and the plurality of encryption keys having different origins. Means for generating one random number table as a seed, and an area for storing the random number table.
[0014] 上記乱数表発生装置は、メルセンヌ素数を使用した疑似乱数発生方式又はメルセ ンヌ 'ツイスタによる疑似乱数発生方式により前記乱数表を生成することができる。  [0014] The random number table generating device can generate the random number table by a pseudo random number generation method using Mersenne prime numbers or a pseudo random number generation method by a Mersenne twister.
[0015] また、上記暗号鍵の一つとして時間情報を含むことができる。この場合、乱数表と時 間情報とを演算した結果を乱数表とする手段を備えることができる。 [0015] In addition, time information may be included as one of the encryption keys. In this case, it is possible to provide means for using the result of calculating the random number table and the time information as a random number table.
[0016] また、暗号鍵の一つとして、乱数表発生装置としてのコンピュータシステムに接続し ている機器の固有情報を含むことができる。 [0016] In addition, as one of the encryption keys, unique information of a device connected to a computer system as a random number table generator can be included.
[0017] また、暗号鍵の一つとして、乱数表発生装置としてのコンピュータシステム自体の固 有情報を含むことができる。この場合、コンピュータシステムの固有情報として、当該 コンピュータシステムが内蔵する記憶装置のシリアル番号を取得することができる。 [0017] Further, as one of the encryption keys, unique information of the computer system itself as the random number table generation device can be included. In this case, the serial number of the storage device built in the computer system can be acquired as the unique information of the computer system.
[0018] 本発明において、コンピュータシステムには、組込機器、家電品、携帯機器、小型 情報端末又は小型ゲーム端末機器等も含まれる。 [0018] In the present invention, the computer system includes embedded devices, home appliances, portable devices, small information terminals, small game terminal devices, and the like.
[0019] また、暗号鍵の一つとして、ユーザの生体情報を含むことができる。 [0019] In addition, the user's biometric information can be included as one of the encryption keys.
[0020] また、暗号鍵の一つとして、入力装置から入力された又は自動的に設定したキーヮ ードを含むことができる。 [0020] Also, as one of the encryption keys, a key key input from an input device or automatically set can be included.
[0021] また、暗号鍵の一つとして、連続番号等のユニークコードを、生成する乱数表毎に 与える手段を備えることができる。 [0022] また、乱数表を複数生成し当該複数の乱数表の要素を組み合わせることにより新た な乱数系列を生成する手段を備えることができる。 [0021] Also, as one of the encryption keys, a means for providing a unique code such as a serial number for each random number table to be generated can be provided. [0022] Furthermore, it is possible to provide means for generating a new random number sequence by generating a plurality of random number tables and combining the elements of the plurality of random number tables.
[0023] 次に、本発明の暗号化 Z復号化装置は、上述した乱数表発生装置を備えると共に 、以下の要素を備える。即ち、暗号ィ匕又は復号ィ匕すべき情報を記憶する領域と、乱 数表を用いて暗号化又は復号化すべき情報を暗号化又は復号化する手段と、暗号 化又は復号ィ匕した情報を記憶する領域とを備える。このうち、暗号化又は復号化する 手段は、暗号化又は復号化すべき情報毎に、乱数表発生装置から異なるシードによ る乱数表を個別に生成させ、最近に生成させた乱数表を用いて暗号化又は復号ィ匕 を行う。  Next, the encryption Z decryption device of the present invention includes the random number table generation device described above and the following elements. That is, an area for storing information to be encrypted or decrypted, means for encrypting or decrypting information to be encrypted or decrypted using a random table, and information encrypted or decrypted. A storage area. Among these, the means for encrypting or decrypting individually generates a random number table with a different seed from the random number table generator for each information to be encrypted or decrypted, and uses the recently generated random number table. Encrypt or decrypt.
[0024] この際、暗号鍵に設定する時間情報は、暗号化又は復号化すべき情報に関連する 時間情報とすることができる。  At this time, the time information set in the encryption key can be time information related to information to be encrypted or decrypted.
[0025] 例えば、暗号ィ匕した情報をコンピュータの基本制御ソフトが持つファイル管理システ ムによりファイルとして記憶装置に保存させる手段と、当該暗号ィ匕に用いた時間情報 を当該ファイルの生成時間もしくは更新時間として当該ファイルに保存させる手段と を備免ることができる。 [0025] For example, means for storing encrypted information in a storage device as a file by a file management system possessed by the basic control software of the computer, and the time information used for the encryption key for the generation time or update of the file There is no means to save the file as time.
[0026] また、暗号鍵に設定するユニークコードとしてセクタ及びブロック等の記憶装置の記 録単位を指標する値を与えることができる。この場合、ある記録単位に記録されてい る情報を暗号ィ匕又は複合ィ匕する際に用いる乱数表は、その記録単位を指標する値 をユニークコードに与えて生成する手段を備えることができる。 発明を実施するための最良の形態  [0026] Further, as a unique code set to the encryption key, a value indicating a recording unit of a storage device such as a sector and a block can be given. In this case, the random number table used when encrypting or decrypting the information recorded in a certain recording unit can be provided with means for generating a unique code by giving a value indicating the recording unit. BEST MODE FOR CARRYING OUT THE INVENTION
[0027] 以下、本発明の実施例について図面を用いて説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0028] [実施例 1] [Example 1]
[0029] 本実施例は、暗号化と復号を行うプログラムおよび装置に関する。図 18に本発明 の第 1実施例のコンピュータシステムの電子機器としての全体構成図を示す。  The present embodiment relates to a program and an apparatus that perform encryption and decryption. FIG. 18 shows an overall configuration diagram as an electronic device of the computer system of the first embodiment of the present invention.
[0030] 情報処理装置 (ホスト機器)は、計算機の全体制御および各種プログラムを実行す る中央処理装置 S1811 (以下 CPU)と、各種プログラムやデータがロードされるメモリ 装置 S1813と、 ROMBIOS— S1812と、アダプタ S1815, S1816とを備えている。これら は、システムバス S1814に接続されている。 [0031] このうち、アダプタ S1815には、 HDD— S1830のホストインタフェース S1820が接続さ れている。また、アダプタ S1816には、ストレージデバイスを装着可能なリーダライタ S1 819が接続されている。本実施例では、ストレージデバイス (記憶装置)として、 USB装 置 S1840を装着できるようになつている。 USB装置 S1840は、ストレージデバイスとして の機能を備える。本実施例では、 USB装置 S1840が、メモリディスク装置であるとして 説明するが、本実施例の効果を奏する範囲内であれば任意の装置でよい。 [0030] The information processing device (host device) includes a central processing unit S1811 (hereinafter referred to as CPU) that executes overall control of the computer and various programs, a memory device S1813 in which various programs and data are loaded, ROMBIOS- S1812, And adapters S1815 and S1816. These are connected to the system bus S1814. [0031] Among these, the host interface S1820 of the HDD S1830 is connected to the adapter S1815. In addition, a reader / writer S1 819 to which a storage device can be attached is connected to the adapter S1816. In this embodiment, the USB device S1840 can be mounted as a storage device (storage device). The USB device S1840 has a function as a storage device. In the present embodiment, the USB device S1840 is described as being a memory disk device, but any device may be used as long as the effects of the present embodiment are achieved.
[0032] ROMBIOS— S1812には、 HDD— S1830あるいはストレージデバイスなどのシステ ムブート可能デバイスから一つのデバイスを選択する手段と、当該デバイスカゝらシス テムブートローダをメモリ装置 S1813に読出す手段と、読み出したシステムブートロー ダに分岐する手段 (いわゆるシステムブート機能)とを備える。システムブートにおい て、 HDD— S1830あるいは任意のストレージデバイス力 読み出された OSプログラム 力 メモリ装置 S1813に格納され、 CPU— S1811により実行される。  [0032] ROMBIOS-S1812 includes means for selecting one device from system bootable devices such as HDD-S1830 or a storage device, means for reading the system boot loader from the device module to memory device S1813, and reading And a means for branching to the system boot loader (so-called system boot function). At system boot, the HDD—S1830 or any storage device power read OS program power is stored in the memory device S1813 and executed by the CPU—S1811.
[0033] 次に、上記コンピュータシステムにおいて発生させる乱数の管理方式を説明する。  Next, a method for managing random numbers generated in the computer system will be described.
[0034] 本実施例では疑似乱数発生装置としてメルセンヌ 'ツイスタを使用する。疑似乱数 は、その欠点として周期を持つことが挙げられる。メルセンヌ 'ツイスタは、一定周期で 同じ乱数を生成する。メルセンヌ 'ツイスタは、 2の 19937乗- 1。十進法の場合は約 10 の 6000乗の周期を持つ。つまり、約 10の 6000乗の個数の乱数を繰り返し生成する。 図 1の上図は、その一周期を直線的に表したものである。横軸はデータ長を示し、区 切られた短冊は、その個々力 個の乱数を表す単位データ長である。  In this embodiment, a Mersenne twister is used as a pseudo random number generator. Pseudorandom numbers have a disadvantage that they have a period. Mersenne's twister generates the same random number at regular intervals. Mersenne 'Twister 2-19937-1 The decimal system has a period of about 10 to the 6000th power. In other words, about 10 to the 6000th power of random numbers are repeatedly generated. The upper figure in Fig. 1 shows a straight line of one cycle. The horizontal axis shows the data length, and the divided strips are unit data lengths representing the individual random numbers.
[0035] いま、図 1の下図のように、 2の 19937乗- 1を要素 Nとする巨大な乱数表が存在する。  [0035] Now, as shown in the lower diagram of Fig. 1, there is a huge random number table with 2 as the power of 19937-1 as element N.
S112は、この要素数 nの重なり合わない事を特徴とする小テーブルである。本実施 例の暗号化は、この小テーブル S112を使用して行う。  S112 is a small table characterized in that the number n of elements does not overlap. The encryption in this embodiment is performed using this small table S112.
[0036] 小テーブル S112は、一度使ったならば 2度と使わない。これにより疑似乱数の周期 の中で無限乱数式の暗号化と復号ィ匕を行う。ここで、小テーブル S112は、隙間無く連 続して並んで!/、ることが効率上このまし 、が、空隙があってもよ!、。  [0036] Once used, the small table S112 is not used again. In this way, infinite random number encryption and decryption are performed within the period of the pseudo random number. Here, the small tables S112 are arranged side by side without any gaps! / It is better to be efficient, but there may be gaps!
[0037] メルセンヌ 'ツイスタは、その内部仕様として内部で 2496バイト(624ワード)のテープ ルを備え、一つのシードを与えた時発生させる乱数を 2496バイト以下としたとき、当該 テーブルを小テーブル S112として使用できる。この場合、一つのシードにおいて生成 する乱数を 2496バイト以下とし、同じシードを二度と使わな!/ヽと 、う条件にぉ ヽて重 複の起きな!/、乱数を生成し管理できる。 [0037] Mersenne's Twister has a 2496-byte (624-word) table internally as its internal specifications, and when the random number generated when one seed is given is 2496 bytes or less, the table is a small table S112 Can be used as In this case, generated in one seed You can generate and manage random numbers under 2496 bytes, and never use the same seed again!
[0038] 即ち、下記簡素計算式を 1テーブルと見なし、上記理論を確立するものとする。[0038] That is, the following simple calculation formula is regarded as one table, and the above theory is established.
^ s + a = a X n =∞  ^ s + a = a X n = ∞
a = 10の 6000乗  a = 10 to the power of 6000
a'= 2492バイト  a '= 2492 bytes
a" = 623ワード数  a "= 623 words
s = 1つのシード  s = 1 seed
n =テープノレ数  n = number of tapes
∞ =無限数値  ∞ = Infinite value
[0039] 続いて、本実施例の暗号化の方法を、図 2に基づいて説明する。 S210は、暗号化し たい平文である。また、 S211は、乱数表である。乱数表 S211は、一つ一つ異なるシー ドで生成した小テーブル S112の集合体である。そして、平文 S210の各要素と、小テー ブル S211の各要素とを 1対 1、つまりバイト単位で排他的論理和をとつた結果が S212 である。  Subsequently, the encryption method of the present embodiment will be described with reference to FIG. S210 is the plaintext that you want to encrypt. S211 is a random number table. The random number table S211 is a collection of small tables S112 generated with different seeds. The result of XORing each element of the plaintext S210 and each element of the small table S211 on a one-to-one basis, that is, in byte units is S212.
[0040] このように、 S210と S211の間で演算を行うことにより暗号化ができる。演算の種類とし ては排他的論理和の他に加算ないし減算をしてもよいが、処理が簡単と言う理由で 排他的論理和を本実施例では採用する。排他的論理和を使用した場合、復号も同 一の排他的論理和で足り、コンピュータ処理に向いている力もである。即ち、平文 S21 0を復号したい場合、暗号化されたデータ S212と、暗号化した時に使用した乱数表と の排他的論理和を取ることによって、平文 S210を復号することが出来る。  [0040] Thus, encryption can be performed by performing an operation between S210 and S211. As the type of operation, addition or subtraction may be performed in addition to exclusive OR, but exclusive OR is adopted in this embodiment because the processing is simple. When exclusive OR is used, the same exclusive OR is sufficient for decoding, and it is also suitable for computer processing. That is, when it is desired to decrypt the plaintext S210, the plaintext S210 can be decrypted by taking the exclusive OR of the encrypted data S212 and the random number table used at the time of encryption.
[0041] 続いて、図 3は、本実施例のシステムの物理的全体像を示す。 S310は、図 18に示し たコンピュータの USBコネクタである。また、 S311は、指紋認証装置を内蔵した USBメ モリ装置 (S1840)である。本実施例は、指紋認証装置を内蔵した USBメモリ装置により 試作を行ったが、本発明は、この指紋認証装置を必須とするものではない。指紋認 証装置は、実施例の一つであることを明示する。  Subsequently, FIG. 3 shows a physical overview of the system of the present embodiment. S310 is a USB connector of the computer shown in FIG. S311 is a USB memory device (S1840) with a built-in fingerprint authentication device. In the present embodiment, a prototype was made using a USB memory device with a built-in fingerprint authentication device, but the present invention does not require this fingerprint authentication device. It is clearly indicated that the fingerprint authentication device is one of the embodiments.
[0042] 続いて、図 4に、本実施例で採用した USBメモリ装置の使い方を説明する。なお、 U SBの基本制御ソフトには、米マイクロソフト社のものを使用している。 [0043] 本 USBメモリ装置を USBコネクタ S310に接続すると、コンピュータシステムは、表示装 置の画面上に S410の画面を表示する。画面上には、 CD- ROM装置 S411と、リムーバ ブルディスク S412とが出現する。 Subsequently, FIG. 4 explains how to use the USB memory device employed in this embodiment. Note that the basic control software for USB is from Microsoft Corporation. [0043] When the USB memory device is connected to the USB connector S310, the computer system displays the screen of S410 on the screen of the display device. A CD-ROM device S411 and a removable disk S412 appear on the screen.
[0044] 続いて、コンピュータシステムは、 S416の指紋認証を促す画面を表示装置に表示 する。ユーザが入力装置から認証を指示すると、コンピュータシステムは、 S417の指 紋認証画面を表示装置に表示する。ユーザが、 USBメモリ装置に内蔵された指紋セ ンサ一に指をスライドさせると、コンピュータシステムは、ユーザの指紋情報を読み取 り、指紋認証を実行する。指紋認証が通ると、コンピュータシステムは、 S410の画面を S413の画面に切り替える。  [0044] Subsequently, the computer system displays a screen prompting fingerprint authentication in S416 on the display device. When the user instructs authentication from the input device, the computer system displays the fingerprint authentication screen of S417 on the display device. When the user slides his / her finger on the fingerprint sensor built in the USB memory device, the computer system reads the user's fingerprint information and performs fingerprint authentication. When fingerprint authentication passes, the computer system switches the screen of S410 to the screen of S413.
[0045] 画面の切替後に表示される S414と S415は、指紋認証した時に始めて出現する保護 されたディスク領域である。なお、この一連の処理を行うためには、 USBメモリ装置付 属のツールでユーザの指紋を予めコンピュータシステムに登録しておく必要がある。  [0045] S414 and S415 displayed after switching the screen are protected disk areas that appear only when fingerprint authentication is performed. In order to perform this series of processing, it is necessary to register the user's fingerprint in the computer system in advance using the tool attached to the USB memory device.
[0046] ここで、この指紋認証および USBメモリ装置の使 、方を述べるのは、本発明の理解 を促進するためであり、本発明とは直接関係ないことを明示しておく。  [0046] Here, the use of the fingerprint authentication and the USB memory device will be described in order to facilitate understanding of the present invention, and it is clearly shown that it is not directly related to the present invention.
[0047] 図 5は、上述したコンピュータシステムにおいて乱数を生成する際のシードとなる n 個の暗号鍵を示す。まず、本実施例では、静的に定まる暗号鍵を持つ。これらは、本 装置が作動する上で必須の情報である。  FIG. 5 shows n encryption keys that serve as seeds when generating random numbers in the above-described computer system. First, in this embodiment, the encryption key is statically determined. These are essential information for the operation of this device.
[0048] 図 5において、 S510は、暗号鍵生成用のメモリ領域である。本実施例では 624ヮー ド (2496バイト)のサイズを確保する。このサイズは、本実施例が採用しているメルセン ヌ 'ツイスタ公開プログラム(2002年版 (mtl9937ar.c))に設定できるシードの最大桁数 に合わせている。ただし、 624ワードのサイズを確保しているが全てを使う必要はない  In FIG. 5, S510 is a memory area for generating an encryption key. In this embodiment, a size of 624 bytes (2496 bytes) is secured. This size is matched to the maximum number of seeds that can be set in the Mersenne Twister Open Program (2002 version (mtl9937ar.c)) used in this example. However, the size of 624 words is secured, but it is not necessary to use all of them.
[0049] ここで、メモリ領域 S510には、誤動作を防ぐため、このメモリ領域を確保した時に一 度全てゼロを格納するものとする。その上で内部の各要素を格納するものとする。ま た、メモリ領域 S510に格納する暗号鍵のうち静的に定まる各要素 S511〜S514は、全 て使用するか否かは任意とする。使用する項目には有値を格納し、使わない項目の 値はゼロとする。ここで、静的に定まる各要素とは、後述する時間情報および連続番 号 (動的暗号鍵 S610)以外の要素のことである。 [0050] 静的に定まる各要素のうち、キーワード S511は、本実施例が作動するコンピュータ システムに記憶する値であり、任意の文字列である。本実施例では、 128バイト以内 のアスキー文字列とし、この文字列はヌルコードで終端するものとする。このキーヮー ド S511は、 S515に示すような入力画面を介して初期値を設定し、コンピュータが不揮 発性の記憶装置に保存する。 Here, in order to prevent malfunction, the memory area S510 is assumed to store all zeros once when this memory area is secured. Then, each internal element is stored. Also, whether or not to use all the statically determined elements S511 to S514 in the encryption key stored in the memory area S510 is arbitrary. Store a value in the item to be used, and set the value of the unused item to zero. Here, each element determined statically is an element other than time information and a serial number (dynamic encryption key S610) described later. [0050] Among the statically determined elements, the keyword S511 is a value stored in the computer system in which this embodiment operates, and is an arbitrary character string. In this embodiment, the ASCII character string is 128 bytes or less, and this character string is terminated with a null code. This keyboard S511 sets an initial value via an input screen as shown in S515, and the computer stores it in a nonvolatile storage device.
[0051] また、コンピュータ固有情報 S512は、本実施例が動作しているコンピュータシステム もしくは端末のユニークコードを読み取り格納するものである。本実施例において、コ ンピュータ固有情報を格納するメモリ領域は、 4バイトの領域とする。例えば、米マイク 口ソフト社の基本制御ソフトでは、ディスク装置を使用するにあたり、ディスク装置を初 期化する毎に、ボリュームシリアル番号と呼称する 4バイトのユニークコードを発行す る。本実施例では、この 4バイトの値を固有情報 S512としてメモリ領域 S511に書き込む ものとする。  [0051] The computer specific information S512 reads and stores the unique code of the computer system or terminal in which this embodiment is operating. In this embodiment, the memory area for storing the computer specific information is a 4-byte area. For example, when using a disk device, the basic control software of Microphone Software Inc. in the US issues a 4-byte unique code called a volume serial number each time the disk device is initialized. In this embodiment, it is assumed that the 4-byte value is written in the memory area S511 as the unique information S512.
[0052] 図 5において、 S516の画面には、この 4バイトのユニークコードが示されている。この S516の画面は、ディスクの一覧情報を採取したものである。このうち、 S517の 16進コ ードがこの 4バイトコードである。  In FIG. 5, the 4-byte unique code is shown on the screen of S516. This S516 screen is a collection of disk list information. Of these, the S517 hexadecimal code is the 4-byte code.
[0053] 一方、本実施例において、コンピュータシステムのユニークコードのチェックをしたく ない場合は、常にこのコンピュータ固有情報 S512の領域にゼロを格納しておくものと する。この場合、どのコンピュータシステムに USBメモリ装置 S311を接続してもゼロとな り暗号鍵のチェックが緩くなる。  On the other hand, in this embodiment, when it is not desired to check the unique code of the computer system, zero is always stored in the area of the computer specific information S512. In this case, no matter which computer system the USB memory device S311 is connected to, it becomes zero and the encryption key check becomes loose.
[0054] 続いて、 S513には、 USBメモリ装置 S311の製造会社番号、製品番号およびシリアル 番号を登録するものとする。 USB装置は、本来の仕様では製造会社番号、製品番号 、シリアル番号を備える。この 3つのコードの組み合わせを格納するものとする。通常 は、このコードは合計で 24バイトである。余裕を持ち 64バイトの大きさを S513に割り振 る。  Subsequently, in S513, the manufacturer number, product number, and serial number of the USB memory device S311 are registered. A USB device has a manufacturer number, a product number, and a serial number in its original specifications. The combination of these three codes shall be stored. Usually this code is a total of 24 bytes. Allocate a size of 64 bytes to S513 with a margin.
[0055] ここで、 S513に登録する USBの製造会社番号、製品番号は、 USBメモリ装置に製造 時に書き込まれて 、る情報である。これは異なる会社の USBを接続した時にその製 造会社番号、製品番号が格納されないようにするための安全措置である。  Here, the USB manufacturing company number and product number registered in S513 are information written in the USB memory device at the time of manufacture. This is a safety measure to prevent the manufacturer company number and product number from being stored when a USB from a different company is connected.
[0056] ここでは、 USBメモリ装置 S311を接続した時に USBメモリ装置より読み取り S513に格 納するものとする。 [0056] Here, when the USB memory device S311 is connected, it is read from the USB memory device and classified as S513. Shall be paid.
[0057] 続いて、 S514には、 4バイトの生体認証キーを登録する。これは、生体認証の結果 出現する図 4の S415のボリュームシリアル番号を読み取るものとする。本来生体認証 キーを直接読み取るのが好ましいが、指紋認証の場合は管理者を含め複数の人間 が指紋を登録する場合が考えられる。この場合、指紋登録を行った人物毎に異なる 生体認証データが出現する。しかし、複数の人が一台のコンピュータを利用しフアイ ルを共有する場合、暗号ィ匕のキーは共有する必要がある。従い、生体認証キーをそ のまま暗号に使用すると共有が崩れ不都合が発生する。ゆえに、このように S415をキ 一にする必要がある。  [0057] Subsequently, a 4-byte biometric key is registered in S514. This reads the volume serial number of S415 in Fig. 4 that appears as a result of biometric authentication. Originally, it is preferable to read the biometric authentication key directly. However, in the case of fingerprint authentication, it is conceivable that multiple persons including the administrator register the fingerprint. In this case, different biometric data appears for each person who performed fingerprint registration. However, when multiple people share a file using a single computer, it is necessary to share the encryption key. Therefore, if the biometric key is used for encryption as it is, sharing will be lost and inconvenience will occur. Therefore, it is necessary to key S415 in this way.
[0058] これより生体認証の結果出現するコードを生体認証コードとして登録する。  From this, a code appearing as a result of biometric authentication is registered as a biometric authentication code.
[0059] 続いて、 S610は、動的暗号鍵領域を示している。この動的暗号鍵領域 S610に格納 する n個の動的暗号鍵の生成について、図 6を参照しつつ説明する。図 6は、動的暗 号鍵領域 S610のメモリマップを示して!/、る。  Next, S610 indicates a dynamic encryption key area. The generation of n dynamic encryption keys stored in the dynamic encryption key area S610 will be described with reference to FIG. Figure 6 shows the memory map of the dynamic encryption key area S610!
[0060] この図 6において、 S611は、時間情報領域であって、 8バイトのメモリ領域である。こ こにはコンピュータシステムの時間情報を格納する。時間情報の仕様は、コンビユー タに搭載された基本制御ソフトによる力 通常は 4バイトないし 8バイトで示すシステム 秒数を備え、現在の年月日時分秒を一意に決定できる。よくあるシステム秒数は、 1 秒単位で西暦 1970年 1月 1日の 00:00:00から現在に至るまでの秒数になっている。 4 バイトの表現力で約 130年の幅を確保しているので、 2100年までの日時を表現でき 都合がよい。  In FIG. 6, S611 is a time information area, which is an 8-byte memory area. This stores the time information of the computer system. The time information specification is based on the power of the basic control software installed in the computer, usually with system seconds shown in 4 to 8 bytes, and the current year / month / day / hour / minute / second can be determined uniquely. A common system second is the number of seconds from 00:00:00 on January 1, 1970 to the present, in seconds. It is convenient to express the date and time up to 2100 because it has a range of about 130 years with 4 bytes of expressive power.
[0061] 時間情報領域 S611には、暗号ィ匕を行う時には、その時の現在時間を格納する。ま た、この時間情報は、復号ィ匕の際に必要となるため、暗号化したデータを記憶装置 に保存する時に、必ず暗号鍵に使用した時間情報も関連付けて保存するものとする 。この時間情報の保存処理は、本変換プログラム(暗号ィ匕 Z復号ィ匕プログラム)を呼 び出す上位プロセスの役割であり、本変換プログラムに属さないことを明記する。また 上述のとおり、この時間情報がないと暗号ィ匕したデータを復号できない。ゆえに暗号 ィ匕と復号ィ匕をセットで行う上で、上位のプログラムな ヽし装置は必ず時間情報を保存 する必要があることを明記する。 [0062] 時間情報領域 S611には、復号ィ匕を行う時には、暗号化が行われた時の時間を格納 する。時間情報はかならず上位プログラムにより暗号ィ匕したデーターつずつに存在し ている。その時間情報をここに登録する。 [0061] In the time information area S611, when performing encryption, the current time at that time is stored. In addition, since this time information is necessary for decryption, when the encrypted data is stored in the storage device, the time information used for the encryption key is always stored in association with it. This time information storage process is the role of the higher-level process that calls this conversion program (encryption key Z decryption key program), and specifies that it does not belong to this conversion program. Also, as described above, the encrypted data cannot be decrypted without this time information. Therefore, when performing encryption key and decryption key as a set, it is clearly stated that the higher-level program check device must always store the time information. [0062] In the time information area S611, when decryption is performed, the time when encryption is performed is stored. Time information always exists for each piece of data encrypted by a higher-level program. The time information is registered here.
[0063] 続いて、連続番号領域 S612には、ゼロから始る連続番号を格納する。図 6の下図に おいて、 S613は、暗号ィ匕または復号ィ匕したいデータを示している。横軸はデータ長で あり、 N個の要素を備えている。また、 S614は、 RND_SIZEバイト単位の区分を示してい る。本実施例では、 RND_SIZEバイト単位で連続番号を振る。 S613の最初の RND_SIZE の時ゼロ、次の RND_SIZEの時 1、以後一つずつ数字が上がっていく。即ち、 S613とい う暗号化もしくは復号ィ匕したいデータを与えた時、 S614のようにして得られる数字を連 続番号領域 S612に格納する。本実施例において、連続番号領域 S612は、 4バイトの 領域を持つものとする。  [0063] Subsequently, a serial number starting from zero is stored in the serial number area S612. In the lower diagram of FIG. 6, S613 indicates data to be encrypted or decrypted. The horizontal axis is the data length, which has N elements. S614 indicates a division in units of RND_SIZE bytes. In this embodiment, consecutive numbers are assigned in units of RND_SIZE bytes. When the first RND_SIZE of S613 is zero, when the next RND_SIZE is 1, the number is incremented by one. That is, when the data to be encrypted or decrypted S613 is given, the number obtained in S614 is stored in the serial number area S612. In this embodiment, it is assumed that the sequence number area S612 has a 4-byte area.
[0064] また、本実施例において、 RND_SIZEは 2048バイトを示すものとする。 RND_SIZEは、 任意の大きさでよいのであるが、使用する疑似乱数が保障する重複の無い乱数表の 幅に納まる事が好ましい。本実施例ではメルセンヌ ·ツイスタを使用しており、これの 安全な幅が 2496バイトなので、 16進法で切りのよい 2048バイトとしている。この幅は使 用する疑似乱数発生装置の特性に合わせて最良の値を選ぶべきものである。  [0064] Further, in this embodiment, RND_SIZE indicates 2048 bytes. RND_SIZE can be of any size, but it is preferable to fit within the width of the random number table guaranteed by the pseudo-random numbers used. In this embodiment, a Mersenne twister is used, and the safe width of this is 2496 bytes. This width should be chosen according to the characteristics of the pseudorandom number generator used.
[0065] 続いて、 S620は空き領域である。図 5に示す全体領域 S510は 624ワード(2496バイ ト)を確保しており、静的決定暗号鍵 S511〜S514並びに動的暗号鍵である時間情報 領域 S611および連続番号領域 S612を割り振った残りの領域が、空き領域 S620である  Subsequently, S620 is a free area. The entire area S510 shown in FIG. 5 has 624 words (2496 bytes) secured, and the remaining static information keys S511 to S514 and the time information area S611 and sequence number area S612 which are dynamic encryption keys are allocated. The area is a free area S620.
[0066] 本実施例では、この空き領域 S620に、時間情報 S611と連続番号 S612とを繰り返し 保存する。ただし、空き領域 S620が、ゼロでクリアされていても本発明は問題なく動作 する。本実施例で、空き領域 S620に上述のように値を設定するのは、メモリ領域 S510 の取る値をできるだけ、力べ乱し、より品質の良い乱数を生成するための工夫である。 In this embodiment, the time information S611 and the serial number S612 are repeatedly stored in this empty area S620. However, the present invention operates without any problem even if the empty area S620 is cleared to zero. In this embodiment, setting the value in the free area S620 as described above is a device for disturbing the value taken by the memory area S510 as much as possible and generating a higher-quality random number.
[0067] 続いて、図 7に実際に行う暗号ィ匕復号ィ匕の考え方を示す。 S710は、暗号ィ匕ないし復 号化を行いたいデータを示す。このデータは Nバイトの長さを持つものとする(図 1、 図 2において、単位データ長を 1バイトとした場合に相当する)。また、 S711は、図 5に 示したメモリ領域 S510のデータをシードとして生成した RND_SIZEの大きさを持つ乱数 表である(図 1、図 2の小テーブル S112に相当する)。各乱数表 S711は、先頭からの 位置に応じて図 6の S612に格納する連続番号が変化しているので、それぞれ異なる 乱数表として生成される。 Next, FIG. 7 shows the concept of encryption / decryption actually performed. S710 indicates data to be encrypted or decrypted. This data shall have a length of N bytes (corresponding to the case where the unit data length is 1 byte in Figs. 1 and 2). S711 is a random number with the size of RND_SIZE generated using the data in memory area S510 shown in FIG. 5 as a seed. It is a table (corresponding to the small table S112 in FIGS. 1 and 2). Each random number table S711 is generated as a different random number table because the serial number stored in S612 in FIG. 6 changes according to the position from the beginning.
[0068] そして、 S712は、暗号化ないし復号化を行いたいデータ S710と、各乱数表 S711との 排他的論理和を取った結果を示している。 S710が平文の時は暗号ィ匕した結果が S71[0068] S712 shows the result of exclusive OR of the data S710 to be encrypted or decrypted and each random number table S711. When S710 is plaintext, the encrypted result is S71
2になる。 S710が暗号文の時は復号ィ匕し解読した結果が S712となる。 Become 2. When S710 is ciphertext, the result of decryption and decryption is S712.
[0069] 続いて、図 8に本実施例の暗号復号ィ匕装置を実現するプログラムの入出力を示すSubsequently, FIG. 8 shows input / output of a program that realizes the encryption / decryption device of the present embodiment.
。本実施例では暗号化と復号ィ匕は同一の処理を行うので以後、単に「変換」と記載す る。 . In this embodiment, encryption and decryption are performed in the same manner, and hence simply referred to as “conversion”.
[0070] まず、アドレス参照変数を格納するメモリ領域を定義しておく。アドレス参照変数を 格納するメモリ領域は、コンピュータシステムおよび携帯端末にぉ ヽて実装するメモリ 領域を参照する位置を格納するものであり、そのコンピュータシステムにより変化する  First, a memory area for storing an address reference variable is defined. The memory area for storing the address reference variable stores a position for referring to the memory area to be mounted on the computer system and the portable terminal, and changes depending on the computer system.
[0071] 本実施例は、米マイクロソフト社の 32ビットの基本制御ソフトで試作したので、ァドレ ス参照変数を格納するメモリ領域は 4バイトである。ここで、アドレス参照変数は、ボイ ンタ型変数、ポインタ変数またはアドレス変数と同義である。 [0071] Since this embodiment was prototyped with 32-bit basic control software of Microsoft Corporation, the memory area for storing the address reference variable is 4 bytes. Here, an address reference variable is synonymous with a pointer variable, pointer variable, or address variable.
[0072] S810は、アドレス参照変数を格納するメモリ領域である。その内容として図 5に示し たメモリ領域 S510の存在するメモリアドレスを格納する。 S810 is a memory area for storing address reference variables. As the contents, the memory address where the memory area S510 shown in FIG. 5 exists is stored.
[0073] S811は、アドレス参照変数を格納するメモリ領域である。その内容は、暗号化もしく は復号ィ匕した 、データを格納した S814の存在するメモリアドレスを格納する。 S814は 暗号化もしくは復号ィ匕するデータを格納したテーブルである。 S811 is a memory area for storing an address reference variable. The contents are encrypted or decrypted, and the memory address where the data stored in S814 is stored. S814 is a table storing data to be encrypted or decrypted.
[0074] ここで、本プログラムは暗号復号ィ匕を行う部品であり、実際にはプログラムを利用す る上位のプログラムが別途存在する。上位プログラムは変換を行うとき S817により表す データの全体像を持つ。そして、 S814は S817の任意の写像であるものとする。上位プ ログラムは、 S817の変換した!/、場所をメモリ上のテーブルの形で確保格納しこのメモ リアドレスを S811に格納するものとする。 Here, this program is a component that performs encryption / decryption, and actually, there is a higher-order program that uses the program. The host program has an overview of the data represented by S817 when converting. S814 is an arbitrary mapping of S817. The upper program stores and stores the converted! /, Location of S817 in the form of a table in memory, and stores this memory address in S811.
[0075] S815は、 S814に格納したデータが S817のどこ力 始るデータかを表す位置情報で ある。先頭であればゼロである。 100バイト目であれば 100である。 [0076] S816は、 S814に格納したデータが何バイトであるかを表す情報である。 [0075] S815 is position information indicating where the data stored in S814 starts in S817. Zero at the beginning. 100 for the 100th byte. [0076] S816 is information indicating how many bytes the data stored in S814 is.
[0077] S812は、 8バイトのメモリ領域である。内容として S815を格納する。 S812は、 32ビット の基本制御ソフトにおいて通常は 4バイトで十分である力 本プログラムでは余裕を 持たせて 8バイトとする。もし S817が単純にファイルもしくはメモリ上の小さなデータで あれば 4バイトで十分である。一方で、ハードディスクを丸ごと変換する場合もある。こ の場合変換するデータ全体は数十 Gバイトになる。そのような場合も考えて 8バイトと している。 [0077] S812 is an 8-byte memory area. Stores S815 as the contents. In S812, 4 bytes is usually sufficient for 32-bit basic control software. In this program, 8 bytes are provided with a margin. If the S817 is simply a file or small data in memory, 4 bytes is sufficient. On the other hand, the entire hard disk may be converted. In this case, the total data to be converted is several tens of gigabytes. Considering such a case, it is 8 bytes.
[0078] S813は、 4バイトのメモリ領域である。内容としては S816を格納する。  S813 is a 4-byte memory area. Stores S816 as the contents.
[0079] 続いて、図 9に本実施例の制御の流れを示す。図 8により入出力を定めたプロダラ ムの実際の流れを示すものである。  Subsequently, FIG. 9 shows a control flow of the present embodiment. Figure 8 shows the actual flow of the program that defines input and output.
[0080] 本出願の流れ図の特殊記号はコンピュータ言語である C言語に準拠する。 [0080] The special symbols in the flowchart of the present application conform to the C language which is a computer language.
% · · '剰余計算を示す記号である。  % · · 'This is a symbol indicating remainder calculation.
" · · ·排他的論理輪を示す記号である。  "· · · This is a symbol indicating an exclusive logical circle.
++ · · 'インクリメント、値を一つ増加を意味する記号である。  ++ · · 'Increment, a symbol that means incrementing the value by one.
[n ] · · '配列を意味する記号である。 nは配列の添字である。  [n] · · 'This is a symbol that means an array. n is an array index.
*…アドレス型変数の前に記す場合は、変数の示すアドレス上の値を示す。  *: When placed before an address type variable, indicates the value at the address indicated by the variable.
[0081] S910は、初期化処理を行なって!/、る。ここでは、 4バイトのサイズを持つ変数 no、 4 バイトのサイズを持つ変数 ipおよび RND_SIZEの大きさを持つ配列変数 rncLtblを確保 して 、る。 no,ip,rnd_tblの内容は初期化する必要はな!/、。 In S910, initialization processing is performed! Here, a variable no having a size of 4 bytes, a variable ip having a size of 4 bytes, and an array variable rncLtbl having a size of RND_SIZE are allocated. The contents of no, ip and rnd_tbl do not need to be initialized! /.
[0082] S911では、 S812が格納する値を RND_SIZEで割り算した結果を noに格納している。こ れにより、変換に必要な乱数テーブルの連続番号を算出している。 In S911, the result of dividing the value stored in S812 by RND_SIZE is stored in no. As a result, the serial number of the random number table required for conversion is calculated.
[0083] S912は、 S812の剰余を求め、 ipに代入している。 [0083] S912 calculates the remainder of S812 and substitutes it into ip.
[0084] S913では、連続番号領域 S612に noを代入している。つまり、ここで S612に連続番号 を格納している。連続番号領域 S612のアドレスは、 S810が格納している S510のメモリ アドレス力 その位置を算出できる。  In S913, “no” is assigned to the serial number area S612. In other words, the serial number is stored in S612 here. The address of the serial number area S612 can be calculated from the memory address strength of S510 stored in S810.
[0085] S914では、メルセンヌ ·ツイスタにより乱数表を発生させている。具体的には、後述 の図 10、図 11の処理を実行する。後述する S1010に S810の値を格納すると共に、 S1 011には rncLtblのメモリ上の開始アドレスを格納する。そして、図 10、図 11の処理を 行う。 In S914, a random number table is generated by a Mersenne twister. Specifically, the processes shown in FIGS. 10 and 11 described later are executed. The S810 value is stored in S1010, which will be described later, and the start address on the memory of rncLtbl is stored in S1 011. And the processing of Fig. 10 and Fig. 11 Do.
[0086] S915はループである。初期値として変数 i=ゼロとし、一回りするごとに iを 1加算する 。そして、 iが RND_SIZE回ループする。つまり i= 0...i=RND_SIZE-lの値の間でループ を繰り返す。  [0086] S915 is a loop. The variable i is set to zero as an initial value, and i is incremented by 1 for each round. Then i loops RND_SIZE times. In other words, the loop is repeated between i = 0 ... i = RND_SIZE-l.
[0087] S916は制限子である。 ipは、現在使用して 、る乱数表 rnd_tblの参照位置を示す。 ip が RND_SIZE以下の値を取る時、正しく乱数表を参照している。一方、 ipが RND_SIZE をオーバーした時は、乱数表を使 、切ったときである。  [0087] S916 is a restrictor. ip indicates the reference position of the random number table rnd_tbl currently used. When ip takes a value less than RND_SIZE, it correctly refers to the random number table. On the other hand, when ip exceeds RND_SIZE, it is when the random number table is used and cut.
[0088] S917は、実際の変換処理を行っている。 S811の示すメモリアドレスの上から i番目の 要素と rnd_tblの上力も ip番目の要素の排他的論理和をとり、代入している。代入先はIn S917, an actual conversion process is performed. The i-th element from the top of the memory address indicated by S811 and the upper force of rnd_tbl also take the exclusive OR of the ip-th element and substitute it. Assigned to
S811の示すメモリアドレスの上から i番目の要素である。 This is the i-th element from the top of the memory address indicated by S811.
[0089] S918では ipを 1つ増加している。これにより、利用する乱数の要素を次にずらしてい る。 [0089] In S918, ip is increased by one. This shifts the elements of random numbers to be used next.
[0090] S919では連続番号を 1つ増加して!/、る。この処理は!、ままで使って!/、た乱数を使!ヽ 切った時の処理である。次の乱数表を生成する準備を行って 、る。  [0090] In S919, increment the serial number by one! Use this process !, just use it! /, Use random numbers!処理 This is the process when cut. Prepare to generate the next random number table.
[0091] S920は ipにゼロを代入している。新しい乱数を生成するにあたり使用開始位置を示 す ipをクリアしている。  [0091] S920 substitutes zero for ip. When generating a new random number, the ip indicating the starting position is cleared.
[0092] S921では、 S612に noを代入している。つまり、ここで S612に連続番号を格納している [0093] 続いて、図 10に乱数生成プログラムの入出力を示す。  In S921, no is substituted for S612. That is, the serial number is stored in S612. [0093] Next, FIG. 10 shows input / output of the random number generation program.
[0094] S1010は、アドレス参照変数を格納するメモリ領域である。その内容として S510の存 在するメモリアドレスを格納する。  S1010 is a memory area for storing address reference variables. The memory address where S510 exists is stored as its contents.
[0095] S1011は、アドレス参照変数を格納するメモリ領域である。その内容は、乱数表の存 在するメモリアドレスを格納する。この乱数表は、図 9に記載の rnt_tblのことである。 S9S1011 is a memory area for storing address reference variables. The contents store the memory address where the random number table exists. This random number table is rnt_tbl shown in FIG. S9
10で確保した RND_SIZEの大きさを持つメモリ領域である。 This memory area has the size of RND_SIZE allocated in 10.
[0096] 続、て、図 11に乱数生成プログラムの処理を示す。 Subsequently, FIG. 11 shows the processing of the random number generation program.
[0097] S1110では、初期化処理を行う。ここでは、内部で使用する変数を確保している。 no は 4バイトサイズの変数である。また、 ptrはアドレス型変数であり、 4バイト単位のメモリ を参照する目的で確保する。 iは 4バイトサイズの変数である。 [0098] また、メルセンヌ 'ツイスタが使用する内部作業メモリもここで初期化する。これは、 内部作業メモリの初期値が不定のためにメルセンヌ 'ツイスタの生成する乱数が不定 になることを避けるためである。 In S1110, initialization processing is performed. Here, variables used internally are secured. no is a 4-byte variable. Ptr is an address type variable, and is reserved for the purpose of referring to 4-byte memory. i is a 4-byte variable. [0098] The internal working memory used by the Mersenne Twister is also initialized here. This is to avoid indefinite random numbers generated by Mersenne's twister because the initial value of the internal working memory is undefined.
[0099] S1111では、乱数のシードを与えている。メルセンヌ 'ツイスタが公開している標準関 数 init_by_array()を実行している。この関数には、 S510をシードとして与えている。同関 数は、シード発生の鍵となるデータを格納しているメモリ領域のアドレスと、その長さと を指定して呼び出すものである。ここでは、 S510の開始アドレスとその領域の長さを与 えている。  In S1111, a random number seed is given. The standard function init_by_array () published by Mersenne 'Twister is executed. S510 is given as a seed to this function. The function is called by specifying the address and length of the memory area that stores the key data for seed generation. Here, the start address of S510 and the length of the area are given.
[0100] SI 112では、変数 noに RND_SIZEを 4で割った値を代入して!/、る。メルセンヌ ·ッイス タは、 1ワードつまり 4バイト単位で乱数を発生させる。従い、ここで RND_SIZEを充填 するのに必要な乱数の発生回数を算出している。  [0100] In SI 112, substitute the value obtained by dividing RND_SIZE by 4 for the variable no! /. The Mersenne twister generates a random number in units of 1 word or 4 bytes. Therefore, the number of random numbers required to fill RND_SIZE is calculated here.
[0101] S1113は、変数 ptrに S1011の値を代入している。  [0101] S1113 assigns the value of S1011 to the variable ptr.
[0102] S1114は、 no回ループ処理をして!/、る。  [0102] S1114 performs a loop process no times!
[0103] S1115は、乱数を発生させている。メルセンヌ 'ツイスタの公開関数 genrand_int32()を 実行している。この関数の帰り値は 4バイトの乱数である。この 4バイトの乱数を ptrの 示すアドレス領域に代入して 、る。一度に 4バイトの乱数を格納して 、る。  [0103] S1115 generates a random number. Mersenne 'Twister public function genrand_int32 () is executed. The return value of this function is a 4-byte random number. This 4-byte random number is assigned to the address area indicated by ptr. Store a 4-byte random number at a time.
[0104] S1116は、任意のブラックボックス処理である。この処理はなくても良い。メルセンヌ' ツイスタが生成する乱数をそのまま採用すると、アルゴリズムが公開されているので暗 号用乱数としては好ましくない。これを是正するために、任意の変形をかけるのが好 ましい。その変形処理を S1116で行っている。 S1116がなくても問題なく動作する。しか し入れることにより信頼性を上げることができる。  [0104] S1116 is an optional black box process. This processing is not necessary. If the random number generated by Mersenne 'Twister is adopted as it is, it is not preferable as a random number for encryption because the algorithm is publicly available. In order to correct this, it is preferable to apply arbitrary deformation. The transformation process is performed in S1116. It works without problems even without S1116. However, the reliability can be improved by incorporating it.
[0105] S1117は、変数 ptrを増加している。ここでは、 ptrの示すメモリアドレスの値を 4バイト 分加算している。変数 ptrは 4バイトを参照するアドレス型変数である。ゆえに、指示す る値を一つ増やすと言うことは次の 4バイトの領域を示すこととなり、実際にはメモリア ドレスが 4つ程増加する。表記上は 1加算であるが、バイト換算では 4加算であること をここに付記する。  [0105] In S1117, the variable ptr is increased. Here, the memory address indicated by ptr is added by 4 bytes. The variable ptr is an address type variable that references 4 bytes. Therefore, increasing the indicated value by one indicates the next 4-byte area, and actually increases the memory address by four. It is added here that it is 1 addition on the notation but 4 addition in byte conversion.
[0106] 続いて、図 12に固有機器のユニークコードを取得するプログラムの流れを記述する 。本実施例は暗号化復号化を行う装置であり、固有機器のユニークコードは、上位プ ログラムないし上位装置にて取得を行い、図 5の S513に格納するものである。ここで は、試作にあたり実装した上位プログラムがユニークコードを取得するプログラムを記 述する。ここにおいて、ユニークコードの取得が可能であることを証明し、その機構を 表す。 [0106] Next, FIG. 12 describes the flow of a program for acquiring a unique code of a specific device. This embodiment is an apparatus that performs encryption / decryption. It is acquired by a program or a host device and stored in S513 in FIG. Here, we describe a program in which a higher-level program implemented for prototyping acquires a unique code. Here, it is proved that a unique code can be obtained, and its mechanism is shown.
[0107] 本実施例では、固有機器として指紋認証機能内蔵の USBメモリ装置の認識とその 固有コードの識別を行う。  In this embodiment, recognition of a USB memory device with a built-in fingerprint authentication function as a unique device and identification of the unique code are performed.
[0108] S1220は、 USB機器の持つ、製造会社コード、製品番号、シリアル番号を表にして表 したものである。 16進 4バイトの製造会社を識別するコードを持つ。同様に 16進 4バ イトの製品番号を持つ。そして、 16バイトのシリアル番号を持つ。本試作では、シリア ル番号の桁数は余裕を持たせ 54バイトとし、合計で 64 ノイトとしている。  [0108] S1220 is a table showing the manufacturer code, product number, and serial number of the USB device. Hexadecimal A 4-byte code that identifies the manufacturer. Similarly, it has a 4-byte hexadecimal product number. And it has a 16-byte serial number. In this prototype, the serial number has a margin of 54 bytes, giving a total of 64 bytes.
[0109] S1221は、この会社番号、製造番号、製品番号を米マイクロソフト社の 32ビットの基 本共通ソフトのレジストリに登録している文字列を参考に表している。基本共通ソフト により表現方法は異なる力 このように登録して管理している。各コードをアスキー文 字列に変換して一つの文字列に連結して管理している。基本共通ソフトは、このよう にして現在接続して!/、る USB装置のユニークコードを取得できるようにして!/、る(レジ ストリとは、基本共通ソフトが管理用に内蔵して 、るデータベースである)。  [0109] S1221 represents the company number, serial number, and product number with reference to a character string registered in the registry of 32-bit basic common software of Microsoft Corporation. Different ways of expression depending on the basic common software. Each code is converted to an ASCII character string and concatenated into a single character string for management. In this way, the basic common software is now connected! /, So that the unique code of the USB device can be obtained! /, (The registry is the basic common software built in for management. Database).
[0110] S1210は、初期化を行っている。当プログラムが終了し、呼び出しもとの上位プログ ラムに渡す値をゼロクリアするものとする。  [0110] S1210 performs initialization. When this program ends, the value passed to the calling upper program is cleared to zero.
[0111] S1211は、永久ループである。  [0111] S1211 is an endless loop.
[0112] S1212は、基本共通ソフトから現在接続している USB機器のユニークコードを取得す る。本試作では初回は最初の接続機器を取得。ループして 2回目には 2つめの接続 機器を取得。これを繰り返し接続機器の取得を全て行うと取得失敗の動作をする。  [0112] S1212 obtains the unique code of the currently connected USB device from the basic common software. In this prototype, the first connected device is acquired for the first time. Loop and get the second connected device for the second time. If this is repeated and all of the connected devices are acquired, the acquisition fails.
[0113] S1213では、接続機器 S311の有無を判定する。なしの場合は、プログラムを終了す る。この時、 S1210で設定しているゼロクリアしたメモリ領域を上位プログラムに返り値 として格納している。  In S1213, the presence / absence of the connected device S311 is determined. If none, exit the program. At this time, the zero-cleared memory area set in S1210 is stored in the upper program as a return value.
[0114] 接続機器 S311が存在する場合、 S1214では、接続機器 S311から取得した S1221のご とき値の会社番号を判定する。この際、事前に本プログラムに書き込んでいる製造会 社コードとの一致を判定する。プログラムに組み込む製造会社コードは本プログラム を製造販売する時に純正指定もしくは対応する会社のコードを埋め込むものとする。 [0114] If the connected device S311 exists, in S1214, the company number of the value such as S1221 obtained from the connected device S311 is determined. At this time, it is determined whether it matches the manufacturing company code written in this program beforehand. The manufacturer code to be included in the program is this program The code of the company specified or the corresponding company shall be embedded when manufacturing and selling.
[0115] 製造会社コードが一致した場合、 S1215では、取得した S1221のごとき値の製品番 号を判定する。この際、事前に本プログラムに書き込んでいる製品番号コードとの一 致を判定する。プログラムに組み込む製品番号コードは、本プログラムを製造販売す る時に純正指定もしくは対応する会社のコードを埋め込むものとする。  [0115] If the manufacturing company codes match, in S1215, the obtained product number as in S1221 is determined. At this time, it is determined whether or not it matches the product number code written in this program in advance. The product number code to be incorporated into the program shall be genuinely designated or embedded with the corresponding company code when this program is manufactured and sold.
[0116] 製品番号コードが一致した場合、 S1216において、製造会社コード、製品番号コー ド、シリアル番号を帰り値に格納する。  [0116] If the product number code matches, the manufacturer code, product number code, and serial number are stored in the return value in S1216.
[0117] 本プログラムの機構を利用することにより、図 5の接続機器情報領域 S513に、接続 機器 S311のユニークコードを登録し、本実施例の接続機器 S311を利用した暗号鍵の 使用を行う。  By using the mechanism of this program, the unique code of the connected device S311 is registered in the connected device information area S513 of FIG. 5, and the encryption key using the connected device S311 of this embodiment is used.
[0118] 本実施例は、以上説明した技術を用いることにより、(1)図 5に示すメモリ領域 S510 に静的暗号鍵と動的暗号鍵からなる暗号鍵を格納し、 (2)この暗号鍵に基づ 、て生 成したシードをメルセンヌ ·ツイスタに入力して乱数表を生成する。当該乱数表は、暗 号鍵に連続番号 S612が含まれることによって、それぞれ異なる乱数表 0〜nとして図 7 のごとく生成される。(3)そして、図 7に示すように、暗号化または復号化するデータ S 710と、各乱数表 S711との排他的論理和を取ることによって、暗号化結果または復号 結果 S712を得るものである。(4)そのコンピュータ処理は、図 18および図 3に示すノヽ 一ドウエアによって行われ、その処理内容は、図 8から図 12までに説明したメモリ領 域の利用とプログラム処理によって、行われる。  [0118] In the present embodiment, by using the technology described above, (1) an encryption key composed of a static encryption key and a dynamic encryption key is stored in the memory area S510 shown in FIG. Based on the key, the seed generated is input to the Mersenne Twister to generate a random number table. The random number table is generated as different random number tables 0 to n as shown in FIG. 7 by including the serial number S612 in the encryption key. (3) Then, as shown in FIG. 7, the encryption result or the decryption result S712 is obtained by taking the exclusive OR of the data S 710 to be encrypted or decrypted and each random number table S711. . (4) The computer processing is performed by the firmware shown in FIG. 18 and FIG. 3, and the processing content is performed by using the memory area and the program processing described in FIG. 8 to FIG.
[0119] 本実施例において、すべてのコンピュータ処理は、コンピュータがプログラムを実行 することによって実現される。また、コンピュータ処理に用いるデータは、コンピュータ によって、必要に応じて記憶装置から読み出され、また、必要に応じて記憶装置に格 納される。ユーザ力 コンピュータへの指示は入力装置の操作によって行われ、また 、コンピュータ力 コンピュータへの情報出力は、表示装置などの出力装置によって 行われる。後述の実施例においても同様である。  In the present embodiment, all computer processing is realized by a computer executing a program. Data used for computer processing is read from the storage device by the computer as necessary, and stored in the storage device as necessary. Instruction to the user force computer is performed by operating the input device, and information output to the computer force computer is performed by an output device such as a display device. The same applies to the embodiments described later.
[0120] [実施例 2]  [0120] [Example 2]
[0121] 実施例 2では、実施例 1よりも高速に乱数を生成する装置およびプログラムを紹介 する。まず、図 13に基づき、本実施例の変換 (暗号化 Z復号化)の概要を説明する。 [0122] S1310,S1311,S1312は、 RND_SIZEの乱数表である。この乱数表は、大きさはそれぞ れ任意でよいが、管理しやすいという理由でここでは RND_SIZEとしている。 [0121] In the second embodiment, an apparatus and a program for generating random numbers faster than in the first embodiment will be introduced. First, an outline of the conversion (encryption Z decryption) of the present embodiment will be described based on FIG. [0122] S1310, S1311, and S1312 are RND_SIZE random number tables. This random number table can be of any size, but is RND_SIZE here because it is easy to manage.
[0123] また 3つ用意しているのも、本来は n個となり任意でよいが、 RND_SIZEの大きさから 現実的な数としと 3を割り出している。今、 S1310,S1311,S1312には、それぞれ異なる 乱数表を格納して 、るものとする。 [0123] The number of three prepared is originally n and may be arbitrary. However, 3 is calculated as a realistic number from the size of RND_SIZE. Now, it is assumed that different random number tables are stored in S1310, S1311, and S1312, respectively.
[0124] S1313は、変換を行いたい任意のデータである。また、 S1319は、変換を行った結果 のデータである。 [0124] S1313 is arbitrary data to be converted. S1319 is data resulting from the conversion.
[0125] S1314は、 S1310,S1311,S1312の排他的論理和を取り生成した RND_SIZEの大きさを 持つ乱数表である。 S1314の最初の 1バイトは、 S1310,S1311,S1312それぞれの最初 の 1バイトについて排他的論理和を取った結果である。 S1314の各要素は、 S1310,S1 311,S1312の同じ位置の要素について排他的論理和を取った結果である。  S1314 is a random number table having the size of RND_SIZE generated by taking the exclusive OR of S1310, S1311, and S1312. The first 1 byte of S1314 is the result of XORing the first 1 byte of S1310, S1311, and S1312. Each element of S1314 is the result of XORing the elements at the same positions of S1310, S1 311, and S1312.
[0126] S1315は、 S1314と同一の工程で生成した乱数表である。ただし、生成する前に、 S1 311を 1バイト回転させた上で生成したものである。この回転は、時計方向、反時計方 向のどちらでもよい。ここでは、反時計回りに 1バイト回転させたものとする。  [0126] S1315 is a random number table generated in the same process as S1314. However, S1 311 is generated by rotating 1 byte before generation. This rotation can be either clockwise or counterclockwise. Here, it is assumed that it is rotated 1 byte counterclockwise.
[0127] S1316、 S1317は、同様にして S1311を各 1バイトずつ回転させてから生成している。  [0127] S1316 and S1317 are generated after rotating S1311 one byte at a time in the same manner.
このようにして乱数を生成していくと、 RND.SIZE回繰り返すと S1311は循環して同じ 乱数を生成するようになる。この時、 S1312を 1バイト反時計回りで回転させる。このよう にして、 n個の乱数表の組み合わせで長周期の乱数を生成できる。ここでは、 RND.SI ZEの乱数表が 3個あるので、 2048 X 2048 X 2048=8,589,934,592つまり約 8Gバイトで 循環して元に戻る周期を持つ乱数表を作ることが出来る(つまり、 3つの乱数表 S1310 ,S1311,S1312の値の組み合わせをずらしながら乱数表 0〜nを生成する)。一つの変 換したいデータに対して個別に生成するのであれば 8Gバイトは十分な大きさである。  When generating random numbers in this way, S1311 will circulate and generate the same random number after repeating RND.SIZE times. At this time, S1312 is rotated 1 byte counterclockwise. In this way, long-period random numbers can be generated by combining n random number tables. Here, since there are three RND.SI ZE random number tables, it is possible to create a random number table with a cycle of 2048 X 2048 X 2048 = 8,589,934,592 or about 8 Gbytes and returning to the original (that is, three random numbers) The random number tables 0 to n are generated while shifting the combinations of the values of the tables S1310, S1311, and S1312. If the data to be converted is generated individually, 8GB is enough.
[0128] 乱数表 S1310,S1311,S1312は、 S1319—つごとにそれぞれ乱数表を生成できると最 も好ましい。しかし、 S1311,S1312を事前に生成しておき、 S1310だけ S1319—つごとに 生成しても品質のよい乱数を生成できる。  [0128] Random number tables S1310, S1311, and S1312 are most preferably able to generate a random number table for each of S1319. However, it is possible to generate high-quality random numbers by generating S1311 and S1312 in advance and generating only S1310 for each S1319.
[0129] 本実施例は、この方式を採用した暗号ィ匕復号ィ匕を行うプログラムと装置を提供する ものである。  The present embodiment provides a program and apparatus for performing encryption / decryption using this method.
[0130] 図 14に本実施例の暗号復号化装置を実現するプログラムの入出力を表す。本実 施例では暗号化と復号ィ匕は同一の処理を行うので以後、単に変換と記載する。 FIG. 14 shows input / output of a program that implements the encryption / decryption device of the present embodiment. Real In the embodiment, encryption and decryption are performed in the same way, and hence simply referred to as conversion.
[0131] まず、アドレス参照変数を格納するメモリ領域を定義しておく。アドレス参照変数を 格納するメモリ領域は、コンピュータシステムおよび携帯端末にぉ ヽて実装するメモリ 領域を参照する位置を格納する物であり、そのコンピュータシステムにより変化する。 本実施例は、米マイクロソフト社の 32ビットの基本制御ソフトで試作したので、ァドレ ス参照変数を格納するメモリ領域は 4バイトである。  [0131] First, a memory area for storing an address reference variable is defined. The memory area for storing the address reference variable is a thing for storing a position for referring to the memory area to be mounted on the computer system and the portable terminal, and changes depending on the computer system. Since this embodiment was prototyped with 32-bit basic control software of Microsoft Corporation, the memory area for storing address reference variables is 4 bytes.
[0132] S1413は、アドレス参照変数を格納するメモリ領域である。この領域には、暗号化も しくは復号化した 、データ S814の存在するメモリアドレスを格納する。図 14にお!/、て 、暗号化もしくは復号化したいデータ S817と、その部分である S814と、データ S817の 中で S814が存在する先頭からの位置 S815と、 S814の長さ S816とは、実施例 1の図 8に 示したものと同一である。よって、同一符号を付して重複説明は省略する。  S1413 is a memory area for storing an address reference variable. In this area, the memory address where the data S814 exists, which is encrypted or decrypted, is stored. In FIG. 14, the data S817 to be encrypted or decrypted, the S814 that is the part, the position S815 from the head where the S814 exists in the data S817, and the length S816 of the S814 are as follows: This is the same as that shown in FIG. Therefore, the same reference numerals are given and redundant description is omitted.
[0133] S1414は、 8バイトのメモリ領域である。この領域には、 S815を格納する。この領域は 、 32ビットの基本制御ソフトにおいて通常は 4バイトで十分である力 本プログラムで は余裕を持ち 8バイトとする。 S817が単純にファイルもしくはメモリ上の小さなデータで あれば 4バイトで十分である。しかし、ハードディスクを丸ごと変換する場合もあり、こ の場合変換するデータ全体は数十 Gバイトになる。そのような場合も考慮して 8バイト としている。  S1414 is an 8-byte memory area. S815 is stored in this area. In this area, 4 bytes is usually sufficient for 32-bit basic control software. This program has a margin of 8 bytes. If the S817 is simply a file or small data in memory, 4 bytes is sufficient. However, the entire hard disk may be converted. In this case, the entire data to be converted is several tens of gigabytes. Considering such a case, it is 8 bytes.
[0134] S1415は、 4バイトのメモリ領域である。この領域には S816を格納する。  [0134] S1415 is a 4-byte memory area. S816 is stored in this area.
[0135] S1416は、 RND_TBLのサイズを持つ乱数表である。図 13の S1310に相当する。これ は実施例 1で説明した図 10、図 11のプログラムにより格納データを生成するものとす る。 [0135] S1416 is a random number table having a size of RND_TBL. This corresponds to S1310 in FIG. In this case, the stored data is generated by the program shown in FIGS. 10 and 11 described in the first embodiment.
[0136] S1417は、 RND_TBLのサイズを持つ乱数表である。図 13の S1311に相当する。これ は実施例 1で説明した図 10、図 11のプログラムにより格納データを生成するものとす る。  [0136] S1417 is a random number table having a size of RND_TBL. This corresponds to S1311 in FIG. In this case, the stored data is generated by the program shown in FIGS. 10 and 11 described in the first embodiment.
[0137] S1418は、 RND_TBLのサイズを持つ乱数表である。図 13の S1312に相当する。これ は実施例 1で説明した図 10、図 11のプログラムにより格納データを生成するものとす る。  [0137] S1418 is a random number table having a size of RND_TBL. This corresponds to S1312 in FIG. In this case, the stored data is generated by the program shown in FIGS. 10 and 11 described in the first embodiment.
[0138] S1410は、アドレス参照変数を格納するメモリ領域である。その内容は、 S1416が存 在するメモリ上のアドレスを格納する。 S1410 is a memory area for storing address reference variables. The content is S1416 Stores the existing memory address.
[0139] S1411は、アドレス参照変数を格納するメモリ領域である。その内容は、 S1417が存 在するメモリ上のアドレスを格納する。  S1411 is a memory area for storing address reference variables. The contents store the address on the memory where S1417 exists.
[0140] S1412は、アドレス参照変数を格納するメモリ領域である。その内容は、 S1418が存 在するメモリ上のアドレスを格納する。 [0140] S1412 is a memory area for storing an address reference variable. The content stores the address on the memory where S1418 exists.
[0141] 続いて、図 15に本実施例の制御の流れを示す。これは、図 14により入出力を定め たプログラムの実際の流れである。 [0141] Next, FIG. 15 shows the flow of control of the present embodiment. This is the actual flow of a program that defines input and output according to Fig. 14.
[0142] まず、 S1510において、初期化処理を行う。ここでは、 4バイト型の変数 i,ipl,ip2,ip3,l wkを確保している。 iplは、 S1416が示す乱数表を管理する。 ip2は、 S1417が示す乱 数表を管理する。 ip3は、 S1418が示す乱数表を管理する。 First, in S1510, initialization processing is performed. Here, the 4-byte variables i, ipl, ip2, ip3, and lwk are reserved. ipl manages the random number table indicated by S1416. ip2 manages the random table indicated by S1417. ip3 manages the random number table indicated by S1418.
[0143] S1511は、 S1416の示す乱数表の最初に使用する位置を算出 Uplに代入している。 S1511 substitutes the position used at the beginning of the random number table shown in S1416 for calculation Upl.
S1511の乱数は、 RND_SIZEの大きさのバッファを巡回利用する。従い、 RND_SIZEで 剰余を取った結果が最初の使用開始点となる。  The random number in S1511 uses a buffer of size RND_SIZE. Therefore, the result of taking the remainder with RND_SIZE is the first use starting point.
[0144] S1512は、 S1417の示す乱数表の最初に使用する位置を算出 Up2に代入している。 S1512 substitutes the position used at the beginning of the random number table shown in S1417 for calculation Up2.
S1512は S1416を一回循環することで 1バイト循環する。従い、 S1314を RND_SIZEで割 り算出している。  S1512 circulates S1416 once to circulate 1 byte. Therefore, S1314 is calculated by dividing by RND_SIZE.
[0145] S1513は、 S1418の示す乱数表の最初に使用する位置を算出 Up3に代入している。  [0145] S1513 substitutes the position used at the beginning of the random number table indicated by S1418 for calculation Up3.
S1513は S1417がー回循環することで 1バイト循環する。従い、 ip2を RND_SIZEで割り 算出している。  S1513 circulates 1 byte as S1417 circulates once. Therefore, ip2 is divided and calculated by RND_SIZE.
[0146] S1514では、 ip2を RND_SIZEで剰余を取り、 ip2に代入している。 S1512での ip2への 代入計算は、 S1417が 1回転以上循環した時の処置をしていない。ここで、剰余を取り 循環した結果を算出している。  [0146] In S1514, the remainder of ip2 is taken with RND_SIZE and assigned to ip2. The substitution calculation for ip2 in S1512 does not take action when S1417 circulates more than one revolution. Here, the result of taking and circulating the surplus is calculated.
[0147] S1515で、 ip3を RND_SIZEで剰余を取り、 ip3に代入している。 S1513での ip3への代 入計算は、 S1418が 1回転以上循環した時の処置をしていない。ここで、剰余を取り循 環した結果を算出している。 S1418が 1回転する事態とは、同じ乱数を発生して再利 用することを意味する。従い、本来発生してはいけない事態であるが安全装置として 存在している。この安全装置が意味をなす時とは、 8Gバイトを越す変換したいデータ が発生した時である。通常はまず考えられない。 [0148] S1516では、変数 lwkに S1414つまり変換したいデータの位置情報を格納している。 [0147] In S1515, the remainder of ip3 is taken with RND_SIZE and assigned to ip3. The substitution calculation for ip3 in S1513 does not take action when S1418 circulates more than one revolution. Here, the result of circulating the remainder is calculated. The situation where S1418 makes one rotation means that the same random number is generated and reused. Therefore, although it should not occur, it exists as a safety device. This safety device makes sense when the data you want to convert exceeds 8GB. Usually not considered first. In S1516, variable lwk stores S1414, that is, position information of data to be converted.
[0149] S1517はループ処理をする。 S1415に格納されている値だけループする。変数 iをル ープカウンタとし、 i=0に始まりループごとに iを一つずつ増加させながらループする。  S1517 performs loop processing. Loops through the value stored in S1415. The variable i is set as a loop counter, and loops starting from i = 0 and increasing i by 1 for each loop.
[0150] S1518と S1519では、 3つの乱数表より変換情報を生成している。具体的には S1518 で、 S1416の上で iplの示す値を要素番号とする値と、 S1417の上で ip2の示す値を要 素番号とする値との排他的論理輪を wkに格納する。 S1519では、 wkと S1418の上で ip 3の示す値を要素番号とする値との排他的論理輪を取り wkに格納している。  [0150] In S1518 and S1519, conversion information is generated from three random number tables. Specifically, in S1518, the exclusive logical ring of the value having the element number as the value indicated by ipl on S1416 and the value having the element number as the value indicated by ip2 on S1417 is stored in wk. In S1519, an exclusive logical ring of wk and a value having the value indicated by ip 3 as an element number on S1418 is taken and stored in wk.
[0151] S1520において、変換したいデータを格納している S1413の先頭から i番目のデータ に wkの排他的論理和を代入している。これにより、 S1413の変換を 1バイト行う。  [0151] In S1520, the exclusive OR of wk is substituted for the i-th data from the beginning of S1413 that stores the data to be converted. As a result, the S1413 conversion is performed by 1 byte.
[0152] S1521では、変数 iplの格納値を一つ増加している。乱数表 S1416の次に使用する 値を設定している。  [0152] In S1521, the stored value of the variable ipl is incremented by one. The value to be used next to the random number table S1416 is set.
[0153] S1522では、変数 ip2の格納値を一つ増加している。乱数表 S1417の次に使用する 値を設定している。  In S1522, the stored value of variable ip2 is incremented by one. The value to be used next to the random number table S1417 is set.
[0154] S1522Aでは、変数 ip3の格納値を一つ増加している。乱数表 S1418の次に使用する 値を設定している。  In S1522A, the stored value of variable ip3 is increased by one. The value to be used next to the random number table S1418 is set.
[0155] S1523では、変数 lwkの格納値を一つ増加して!/、る。 lwkは変換した!/、データの全体 像の中の最初からの位置を示すものである。  [0155] In S1523, the stored value of the variable lwk is increased by one! lwk shows the converted position! /, the position from the beginning of the whole data.
[0156] S1524では、 iplと RND_SIZEとの大小比較を行う。 [0156] In S1524, ipl and RND_SIZE are compared in size.
[0157] S1525は、 iplの格納値が RND_SIZEと同じか大きい時に行う処理である。この判定は 乱数表 S1416の要素数を超えた時の処理である。 iplにゼロを設定し、乱数表 S1416 の使用を先頭に戻している。  [0157] S1525 is a process to be performed when the stored value of ipl is equal to or larger than RND_SIZE. This determination is processing when the number of elements in the random number table S1416 is exceeded. ipl is set to zero, and the use of random number table S1416 is returned to the beginning.
[0158] S1526では、変数 ip2の格納値を一つ増加している。乱数表 S1417の次に使用する 値を設定している。乱数表 S1416がー回転したので、 S1417を 1バイトずらす処置をこ こでしている。 In S1526, the stored value of variable ip2 is incremented by one. The value to be used next to the random number table S1417 is set. Since the random number table S1416 has been rotated, the procedure for shifting S1417 by 1 byte is performed.
[0159] S1527では、 lwkを RND_SIZE2にて割った際の剰余を求める。結果がゼロの時は、 lw kの値は RND_SIZE2の整数倍の時である。この時は、乱数表 S1416,S1417の全組み合 わせがなされた時である。有値の時は、乱数表 S1416,S1417の全組み合わせが一巡 していないときである。 [0160] S1528では、乱数表 S1416と S1417との組み合わせが全てなされたとみなし、乱数表[0159] In S1527, the remainder when lwk is divided by RND_SIZE2 is obtained. When the result is zero, lw k is an integer multiple of RND_SIZE2. This time is when all combinations of the random number tables S1416 and S1417 have been made. When the value is valid, all combinations of the random number tables S1416 and S1417 are not completed. [0160] In S1528, it is assumed that all combinations of random number tables S1416 and S1417 have been made.
S1418を 1バイトずらす処理をして!/、る。変数 ip3の格納値を一つ増加して!/、る。 Process to shift S1418 by 1 byte! Increase the value stored in the variable ip3 by one! /
[0161] S1529では、 ip2と RND_SIZEとの大小比較を行う。 [0161] In S1529, ip2 and RND_SIZE are compared in size.
[0162] S1530では、変数 ip2にゼロを代入している。乱数表 S1417の使用領域が最後に至つ たので初期化して先頭に戻す処理をして 、る。  [0162] In S1530, zero is assigned to the variable ip2. Since the used area of the random number table S1417 has reached the end, it is initialized and returned to the beginning.
[0163] S1531では、 ip3と RND_SIZEとの大小比較を行う。 [0163] In S1531, the size comparison between ip3 and RND_SIZE is performed.
[0164] S1532では、変数 ip3にゼロを代入している。乱数表 S1418の使用領域が最後に至つ たので初期化して先頭に戻す処理をして 、る。  [0164] In S1532, zero is assigned to the variable ip3. Since the used area of the random number table S1418 has reached the end, it is initialized and returned to the beginning.
[0165] 以上説明した本実施例では、実施例 1と同様に、図 8〜図 12の処理を経て、 3つの 乱数表 S1310,S1311,S1312を生成しておき、これら 3つの乱数表を利用して、図 14及 び図 15の処理を行うことにより、データの変換 (暗号ィ匕または復号)を行っている。実 施例 1と重複する部分の説明は省略する。  In the present embodiment described above, similarly to the first embodiment, three random number tables S1310, S1311, and S1312 are generated through the processing of FIGS. 8 to 12, and these three random number tables are used. Then, data conversion (encryption or decryption) is performed by performing the processing of FIG. 14 and FIG. The description of the same part as Example 1 is omitted.
[0166] さて、高速に乱数を生成する事は開発者の課題となっているが、乱数性を高めよう とすると処理が増加し遅くなる傾向がある。一方、本実施例によれば、事前に生成し た 3つの乱数表を複合させ暗号ィ匕に使用する乱数表を生成している。このため、簡 単なメモリ操作で乱数表を生成できる。結果、乱数性の高い乱数表を高速に得ること ができる。  Now, generating random numbers at high speed is a problem for developers, but when increasing randomness, processing tends to increase and slow down. On the other hand, according to the present embodiment, a random number table used for encryption is generated by combining three previously generated random number tables. For this reason, a random number table can be generated by a simple memory operation. As a result, a random number table with high randomness can be obtained at high speed.
[0167] [実施例 3]  [Example 3]
[0168] 続いて説明する実施例 3は、暗号化 Z復号化を行う簡単なアプリケーションプログ ラムである。暗号化 Z復号化の処理自体は、実施例 1で説明した処理を利用する。  [0168] Example 3 to be described next is a simple application program that performs encryption Z decryption. Encryption Z decryption processing itself uses the processing described in the first embodiment.
[0169] 図 16に本実施例の処理の流れを記述する。本実施例は、基本制御ソフトより実行 し、変換 (暗号ィ匕または復号化)をかけたいファイルを指定する。変換したいファイル を読み込んで変換を実行し、変換結果をファイルとして記憶装置に保存する。本実 施例の示すアプリケーションに一回かけると暗号ィ匕を行う。生成結果を再度本アプリ ケーシヨンにかけると復号を行うものである。  FIG. 16 describes the processing flow of this embodiment. This embodiment is executed from the basic control software, and designates a file to be converted (encrypted or decrypted). Read the file you want to convert, execute the conversion, and save the conversion result as a file in the storage device. Once it is applied to the application shown in this embodiment, encryption is performed. When the generated result is applied again to this application, decryption is performed.
[0170] S1610は初期化を行う。 4バイト変数の ipと noと iとを確保している。また、図 5の S510と して使用するメモリ領域を確保している。また、ファイルの読み書きの作業用メモリ領 域として dat_tblを確保して!/、る。 dat_tblは RND_SIZEの大きさである。 [0171] S1611は、変数 ipにゼロを代入している。 [0170] S1610 performs initialization. The 4-byte variables ip, no, and i are reserved. In addition, the memory area used as S510 in Fig. 5 is secured. Also, allocate dat_tbl as a working memory area for reading and writing files. dat_tbl is the size of RND_SIZE. [0171] S1611 assigns zero to the variable ip.
[0172] S1612では、 S512の記憶領域(コンピュータ固有情報領域)をゼロクリアしている。 S5 12の領域において、メモリの初期値の不定により、変換結果が不定になることをここで 回避している。  In S1612, the storage area (computer specific information area) of S512 is cleared to zero. In the area of S512, it is avoided here that the conversion result becomes indefinite due to the indefinite memory initial value.
[0173] S1613では、変換元のファイル名を入力している。これは、ディスク上のファイル名パ スを対話形式で当アプリケーションの実行者に質問するものである。ここで指定したフ アイルを変換の対象とする。  In S1613, the file name of the conversion source is input. This is an interactive question about the file name path on the disk. The file specified here is the target of conversion.
[0174] S1614では、変換元のファイル名をバイナリのリードモードでオープン処理する。 In S1614, the conversion source file name is opened in the binary read mode.
[0175] S1615では、変換先のファイル名をバイナリのライトモードでオープン処理する。ォ ープンする時のファイル名は本実施例では、 S1613で取得したファイル名の最後に". enc"という文字列を追カ卩したもので、 S1613の変換元ファイルと同じパスに保存するも のとする。 In S1615, the conversion destination file name is opened in the binary write mode. In this example, the file name at the time of opening is the one obtained by adding the character string “.enc” to the end of the file name acquired in S1613, and is saved in the same path as the S1613 conversion source file. And
[0176] S1617では、端末情報を取得している。具体的には本実施例が動くコンピュータシ ステムの固有情報を取得するものとする。ここでは、図 5に示したコンピュータ固有情 報領域 S512に、 HDDのボリュームシリアル番号 S517を保存するものとする。  [0176] In S1617, terminal information is acquired. Specifically, it is assumed that the specific information of the computer system on which this embodiment operates is acquired. Here, it is assumed that the HDD volume serial number S517 is stored in the computer-specific information area S512 shown in FIG.
[0177] S1618では、コンピュータシステムに接続している機器情報を取得している。図 12の プログラムを実行し、機器固有情報領域 S513に機器情報を登録する。機器が接続し て!ヽな 、時はここにゼロクリアされた値が入るものとする。  In S1618, device information connected to the computer system is acquired. Execute the program shown in Fig. 12 and register the device information in the device specific information area S513. When the device is connected, the value cleared to zero shall be entered here.
[0178] S1619では、 S1613で取得した変換元ファイルのクリエートタイムを取得している。タリ エートタイムとは、そのファイルを生成した時の時間情報である。この時間情報を図 6 の時間情報領域 S611に格納する。ここではクリエートタイムを使用しているが、ライトタ ィムつまり、最後に書き込みの発生した時間を使用してもよい。重要なことは暗号鍵と して利用する時間情報を統一することである。本実施例ではクリエートタイムで統一し ている。  [0178] In S1619, the creation time of the conversion source file acquired in S1613 is acquired. Tate time is the time information when the file was created. This time information is stored in the time information area S611 in FIG. The create time is used here, but the write time, that is, the last write time may be used. The important thing is to unify the time information used as the encryption key. In this embodiment, the creation time is unified.
[0179] 本実施形態において、 S510を構成する上記以外の暗号鍵は、ここでは使用しない [0179] In this embodiment, encryption keys other than those described above that constitute S510 are not used here.
。未使用の領域にはゼロを値として持つものとする。 . It is assumed that the unused area has a value of zero.
[0180] S1620は、 iをカウンタとして構成する永久ループである。 iの初期値をゼロとし、 1回 ループするごとに iの値を一つ加算する。 [0181] S1621では、変換元のファイルを RND_SIZEの大きさだけシーケンシャルにてバイナ リモードで読み込みを行う。読み込みデータは daUblに格納する。ファイルの残りの データ量が RND_SIZEに満たな!/、時には、存在する量だけ読み取るものである。 [0180] S1620 is an endless loop that configures i as a counter. The initial value of i is set to zero, and the value of i is incremented by 1 for each loop. [0181] In S1621, the conversion source file is read sequentially in the binary mode by the size of RND_SIZE. The read data is stored in daUbl. The remaining amount of data in the file is less than RND_SIZE! / Sometimes, only the amount that exists is read.
[0182] S1622では、 1バイト以上の読み込みが成立したかを判定する。 1バイトでも読めたと きは Yesとする。読み込みがゼロバイトの時は全ファイルデータを読み込み終了とみ なし Noに分岐する。  [0182] In S1622, it is determined whether reading of 1 byte or more has been established. Set to Yes if even 1 byte can be read. When reading is zero bytes, all file data is deemed to have been read and branch to No.
[0183] S1623では、 S1621で読み込みに成功したバイト数を変数 noに代入する。  In S1623, the number of bytes successfully read in S1621 is assigned to the variable no.
[0184] S1624では、連続番号領域 S612に連続番号として iを格納している。乱数のシードを 構成する S510の中の動的暗号鍵をここで設定している。  [0184] In S1624, i is stored as a serial number in the serial number area S612. The dynamic encryption key in S510 that forms the seed of the random number is set here.
[0185] S1625では図 8、図 9に記述した変換プログラムを実行している。図 8において、 S810 にはシード情報を格納した S510の存在するメモリ開始アドレスを格納するものとする。In S1625, the conversion program described in FIGS. 8 and 9 is executed. In FIG. 8, S810 is assumed to store the memory start address where S510 storing the seed information exists.
S811には daUblのメモリ開始アドレスを格納するものとする。 S812には ipの値を格納 するものとする。 S813には noの値を格納するものとする。 It is assumed that the memory start address of daUbl is stored in S811. S812 shall store the value of ip. S813 shall store the value of no.
[0186] S1626では、 dat_tblを変換先ファイルにライトする。シーケンシャルでバイナリモード で書き込みを行う。 In S1626, dat_tbl is written to the conversion destination file. Write sequentially in binary mode.
[0187] S1627では、次のループに備え、 ipの値に noの値をカ卩算している。 S1628では、変換 先ファイルに時間情報をセットする。この時間情報は S1619で取得した時間情報であ る。変換先ファイルに対してクリエートタイムとしてこの時間情報を書き込む。  [0187] In S1627, the value of no is added to the value of ip in preparation for the next loop. In S1628, time information is set in the conversion destination file. This time information is the time information acquired in S1619. This time information is written as the create time for the conversion destination file.
この時間情報をセットすることにより、次回本実施例でこの変換先ファイルを呼んだと きに復号ができるのである。  By setting this time information, decoding can be performed the next time the conversion destination file is called in the present embodiment.
[0188] S1629では変換元ファイルをクローズ処理する。 S1630では変換先ファイルをクロー ズ処理する。  In S1629, the conversion source file is closed. In S1630, the conversion destination file is closed.
[0189] 本実施例によれば、ファイル処理により簡単に暗号ィ匕または復号ィ匕を行うことがで きる。  According to the present embodiment, encryption or decryption can be easily performed by file processing.
[0190] [実施例 4]  [0190] [Example 4]
[0191] 続いて紹介する本実施例も、暗号ィ匕または復号ィ匕を行う簡単なアプリケーションプ ログラムである。暗号ィ匕 Z復号ィ匕の処理自体は、実施例 2のプログラムを実行する暗 号化装置、復号化装置を使用する。 [0192] 図 17に本実施例の処理の流れを記述する。本実施例は基本制御ソフトより実行し 、変換をかけたいファイルを指定する。変換したいファイルを読み込んで変換をし、変 換結果をファイルとして記憶装置に保存する。本実施例の示すアプリケーションに一 回かけると暗号ィ匕を行う。生成結果を再度本アプリケーションにかけると復号を行うも のである。 [0191] This embodiment, which will be subsequently introduced, is also a simple application program for performing encryption key or decryption key. The encryption / decryption process itself uses an encryption device and a decryption device that execute the program of the second embodiment. FIG. 17 describes the processing flow of this embodiment. This embodiment is executed from the basic control software and designates a file to be converted. Read the file you want to convert, convert it, and save the conversion result as a file in the storage device. When it is applied once to the application shown in this embodiment, encryption is performed. When the generated result is applied to this application again, it is decrypted.
[0193] S1710は初期化を行う。 4バイト変数の ipと noと iとを確保している。同様に S510として 使用するメモリ領域を確保している。同様にファイルの読み書きの作業用メモリ領域と して dat_tblを確保して!/、る。  [0193] S1710 performs initialization. The 4-byte variables ip, no, and i are reserved. Similarly, the memory area used as S510 is secured. Similarly, secure dat_tbl as a working memory area for reading and writing files.
[0194] daUblは RND_SIZEの大きさである。同様に乱数表格納用の配列変数として rnd_tbl I,rnd_tbl2,rnd_tbl3を確保する。大きさは 3つとも RND_SIZEである。  [0194] daUbl is the size of RND_SIZE. Similarly, rnd_tbl I, rnd_tbl2, and rnd_tbl3 are secured as array variables for storing the random number table. All three sizes are RND_SIZE.
[0195] S1711は変数 ipにゼロを代入している。  [0195] S1711 assigns zero to the variable ip.
[0196] S1712では、 S512の記憶領域をゼロクリアしている。 S512の領域において、メモリの 初期値の不定により、変換結果が不定になることをここ回避している。  [0196] In S1712, the storage area of S512 is cleared to zero. In the S512 area, it is avoided here that the conversion result becomes indefinite due to the indefinite memory initial value.
[0197] S1713では、変換元のファイル名を入力している。これは、ディスク上のパスおよびフ アイル名を対話形式で当アプリケーションの実行者に質問するものである。ここで指 定したファイルを変換の対象とする。また、ここで指定したファイルのクリエートタイム( 時間情報)を取得し記憶する。 [0197] In S1713, the file name of the conversion source is input. This asks the executor of the application interactively about the path and file name on the disk. The file specified here is the target of conversion. Also, the creation time (time information) of the file specified here is acquired and stored.
[0198] S1714では、変換元のファイル名をバイナリのリードモードでオープン処理する。 In S1714, the conversion source file name is opened in the binary read mode.
[0199] S1715では、変換先のファイル名をバイナリのライトモードでオープン処理する。ォ ープンする時のファイル名は本実施例では、 S1713で取得したファイル名の最後に". enc"という文字列を追カ卩したもので、 S1713で指定した変換元ファイルと同じパスに保 存するものとする。 In S1715, the conversion destination file name is opened in the binary write mode. In this example, the file name at the time of opening is the same as the conversion source file specified in S1713, with the character string ".enc" added to the end of the file name acquired in S1713. Shall.
[0200] S1716では、端末情報を取得している。具体的には本実施例が動くコンピュータシ ステムの固有情報を取得するものとする。ここでは、コンピュータ固有情報領域 S512 に HDDのボリュームシリアル番号 S517を保存するものとする。  [0200] In S1716, terminal information is acquired. Specifically, it is assumed that the specific information of the computer system on which this embodiment operates is acquired. Here, it is assumed that the HDD volume serial number S517 is stored in the computer specific information area S512.
[0201] S1717では、 rnd_tbllに乱数表を格納している。図 10、図 11のプログラムを実行して 乱数を生成し rnd_tbllに格納している。即ち、図 10の S1010に S510の存在するメモリ アドレスを格納する。また、 S1011には rnd_tbllの存在するメモリアドレスを格納する。 そして図 11のプログラムを実行して rnd_tbllに乱数表を得る。 [0201] In S1717, a random number table is stored in rnd_tbll. Random numbers are generated by executing the programs in Fig. 10 and Fig. 11, and stored in rnd_tbll. That is, the memory address where S510 exists is stored in S1010 of FIG. In S1011, the memory address where rnd_tbll exists is stored. Then, execute the program in Fig. 11 to obtain a random number table in rnd_tbll.
[0202] S1718では、コンピュータシステムに接続している機器情報を取得している。図 12の プログラムを実行し、機器固有情報領域 S513に機器情報を登録する。機器が接続さ れていない時はこの領域をゼロクリアした後、先頭の 4バイトに 16進コードの FFFFの 値が入るものとする。これはゼロであった場合 S510の全体の値が S1717で設定した S5 10と同じとなり、つまり同一のシードを与えることになり、結果、 rnd_tbllと rnd_tbl2の乱 数表の内容が同一となり好ましくないからである。従い、機器情報を取得できない時 にはゼロ以外になるように FFFFを与えている。  [0202] In S1718, information on devices connected to the computer system is acquired. Execute the program shown in Fig. 12 and register the device information in the device specific information area S513. When no device is connected, this area shall be cleared to zero, and then the FFFF value of the hexadecimal code will be placed in the first 4 bytes. If this is zero, the overall value of S510 will be the same as S5 10 set in S1717, that is, the same seed will be given, and as a result, the random table contents of rnd_tbll and rnd_tbl2 will be the same, which is not preferable. It is. Therefore, FFFF is given so that it is non-zero when device information cannot be acquired.
[0203] S1719では、 rnd_tbl2に乱数表を格納している。図 10、図 11のプログラムを実行して 乱数を生成 rnd_tbl2に格納している。即ち、図 10の S1010に S510の存在するメモリアド レスを格納する。また、 S1011に rnd_tbl2の存在するメモリアドレスを格納する。そして 図 11のプログラムを実行して rnd_tbl2に乱数表を得る。  [0203] In S1719, a random number table is stored in rnd_tbl2. Generates random numbers by executing the programs in Fig. 10 and Fig. 11 and stores them in rnd_tbl2. That is, the memory address where S510 exists is stored in S1010 of FIG. In addition, the memory address where rnd_tbl2 exists is stored in S1011. Then execute the program in Fig. 11 to obtain a random number table in rnd_tbl2.
[0204] S1720では、 S1713で取得したファイルのクリエートタイムを取得している。クリエート タイムとは、そのファイルを生成した時の時間情報である。この時間情報を時間情報 領域 S611に格納する。ここではクリエートタイムを使用しているがライトタイムつまり、 最後に書き込みの発生した時間を使用してもよい。重要なことは暗号鍵として利用す る時間情報を統一することである。本実施例ではクリエートタイムで統一して 、る。  [0204] In S1720, the creation time of the file acquired in S1713 is acquired. Create time is the time information when the file was created. This time information is stored in the time information area S611. The create time is used here, but the write time, that is, the last write time may be used. The important thing is to unify the time information used as the encryption key. In this embodiment, the creation time is unified.
[0205] 本実施例において、 S510を構成する未設定の暗号鍵はここでは使用しない。未使 用の領域にはゼロを値として持つものとする。  In the present embodiment, the unset encryption key that constitutes S510 is not used here. Unused areas shall have a value of zero.
[0206] S1721では、 rnd_tbl3に乱数表を格納している。図 10、図 11のプログラムを実行して 乱数を生成し rnd_tbl3に格納している。即ち、図 10の S1010に S510の存在するメモリ アドレスを格納する。 S1011に rnd_tbl3の存在するメモリアドレスを格納する。そして図 11のプログラムを実行して rnd_tbl3に乱数表を得る。  [0206] In S1721, a random number table is stored in rnd_tbl3. A random number is generated by executing the programs in Fig. 10 and Fig. 11, and stored in rnd_tbl3. That is, the memory address where S510 exists is stored in S1010 of FIG. Store the memory address where rnd_tbl3 exists in S1011. Then, execute the program in Fig. 11 to obtain a random number table in rnd_tbl3.
[0207] S1722は、 iをカウンタとして構成する永久ループである。 iの初期値をゼロとし、 1回 ループするごとに iの値を一つ加算する。  S1722 is a permanent loop that configures i as a counter. The initial value of i is set to zero, and the value of i is incremented by 1 for each loop.
[0208] S1723では、変換元のファイルを RND_SIZEの大きさだけシーケンシャルにてバイナ リモードで読み込みを行う。読み込みデータは daUblに格納する。ファイルの残りの データ量が RND_SIZEに満たな!/、時には、存在する量だけ読み取るものである。 [0209] S1724では、 1バイトでも読み込みが成立したかを判定する。 1バイトでも読めたとき は Yesとする。読み込みがゼロバイトの時は全ファイルデータ読み込み終了とみなし N ◦に分岐する。 [0208] In S1723, the conversion source file is read sequentially in the binary mode by the size of RND_SIZE. The read data is stored in daUbl. The remaining amount of data in the file is less than RND_SIZE! / Sometimes, only the amount that exists is read. [0209] In S1724, it is determined whether reading is successful even with one byte. Set to Yes if even 1 byte can be read. When reading is zero bytes, it is regarded as the end of reading all file data, and the process branches to N °.
[0210] S1725で、変数 noに、 S1723で読み込みに成功したバイト数を代入する。  [0210] In S1725, the number of bytes successfully read in S1723 is assigned to variable no.
[0211] S1726では、連続番号領域 S612に連続番号として iを格納している。乱数のシードを 構成する S510の中の動的暗号鍵をここで設定している。  [0211] In S1726, i is stored as a serial number in the serial number area S612. The dynamic encryption key in S510 that forms the seed of the random number is set here.
[0212] S1727では図 14、図 15に記述した変換プログラムを実行している。図 14の各入出 力への設定を次に記述する。 In S1727, the conversion program described in FIGS. 14 and 15 is executed. The settings for each input / output in Fig. 14 are described below.
[0213] S1410には rnd_tbl3の存在するメモリ領域開始アドレスを格納する。 [0213] The memory area start address where rnd_tbl3 exists is stored in S1410.
[0214] S1411には rnd_tbl2の存在するメモリ領域開始アドレスを格納する。 [0214] The memory area start address where rnd_tbl2 exists is stored in S1411.
[0215] S1412には rnd_tbllの存在するメモリ領域開始アドレスを格納する。 [0215] The memory area start address where rnd_tbll exists is stored in S1412.
[0216] S1413には dat_tblのメモリ開始アドレスを格納するものとする。 S1414には ipの値を格 納するものとする。 S1415には noの値を格納するものとする。 [0216] The memory start address of dat_tbl is stored in S1413. It is assumed that the value of ip is stored in S1414. S1415 shall store the value of no.
[0217] S1728では、 dat_tblを変換先ファイルにライトする。シーケンシャルでバイナリモード で書き込みを行う。 In S1728, dat_tbl is written to the conversion destination file. Write sequentially in binary mode.
[0218] S1729では次のループに備え、 ipの値に noの値をカ卩算している。  [0218] In S1729, the value of no is added to the value of ip in preparation for the next loop.
[0219] S1730では変換先ファイルに時間情報をセットする。この時間情報は S1713で取得し た時間情報である。さらに変換先ファイルに対してクリエートタイムとしてこの時間情 報を書き込む。この時間情報をセットすることにより、次回本実施例でこの変換先ファ ィルを呼んだときに復号ができるのである。  [0219] In S1730, time information is set in the conversion destination file. This time information is the time information acquired in S1713. In addition, this time information is written as the create time for the conversion destination file. By setting this time information, decoding can be performed the next time the conversion destination file is called in this embodiment.
[0220] S1731では変換元ファイルをクローズ処理する。 S1732では変換先ファイルをクロー ズ処理する。 In S1731, the conversion source file is closed. In S1732, the conversion destination file is closed.
[0221] このようにしても、ファイル処理により簡単に暗号ィ匕または復号ィ匕を行うことができる [0222] [実施例 5]  [0221] Even in this way, encryption or decryption can be easily performed by file processing. [0222] [Embodiment 5]
[0223] 続いて説明する実施例 5は、実施例 1において生成する乱数に、更に時間情報を 影響させ、乱数表を力べ乱し、生成する乱数表間における重複の可能性を排除する ものである。 [0224] 実施例 1が前提としている乱数発生装置であるメルセンヌ ·ツイスタは内部に 624ヮ ード(1ワードは 4バイト)の内部メモリを備え、非特許文献 1によるならば、論理上はシ ードが異なればそのシードに属する 624ワード (2496バイト)のうち最低でも 1ワードは 異なる乱数表を生成することを保障している。つまり、 2496バイト単位で異なる乱数表 が生成されることを保障している。逆に、 2496以下の小さな表においては部分的に同 一の乱数表が出現する可能性を示している。 [0223] In the fifth embodiment to be described subsequently, the random number generated in the first embodiment is further influenced by time information, disturbing the random number table, and eliminating the possibility of duplication between the generated random number tables. It is. [0224] The Mersenne Twister, which is a random number generator premised on the first embodiment, has an internal memory of 624 words (one word is 4 bytes). If the code is different, it is guaranteed that at least one word out of 624 words (2496 bytes) belonging to the seed will generate a different random number table. In other words, it is guaranteed that a different random number table is generated in units of 2496 bytes. Conversely, in small tables below 2496, the same random number table may appear partially.
[0225] 本実施例は、 2496バイト単位以下の小さな乱数表の範囲で、時系列変化に従い重 複の発生しないかく乱を行い、乱数表内の部分的な重複の可能性を排除する機構を 糸且み込んだものである。  [0225] In this example, a mechanism that eliminates the possibility of partial duplication in the random number table by performing disturbance without duplication in accordance with time-series changes within the range of a small random number table of 2496 bytes or less. It is a squeaky thing.
[0226] 図 19は、この機構をプログラムにより実現したものである。図 19は、図 11に記載し た S1116の処理 (任意のブラックボックス処理)を抽出し示した物である。本実施例は、 実施例 1の S1116に、図 19のプログラムを組み込んで実現されるものである。  FIG. 19 shows the mechanism realized by a program. FIG. 19 shows the extracted S1116 process (arbitrary black box process) described in FIG. The present embodiment is realized by incorporating the program of FIG. 19 into S1116 of the first embodiment.
[0227] S1910は、ループカウンタ iの示す値の 3の剰余を調べて!/、る。そして、剰余ゼロの場 合は S1911へ分岐し、剰余 1の場合は S1912に分岐し、剰余 2の場合は S1913に分岐 する。  [0227] S1910 checks the remainder of 3 of the value indicated by the loop counter i! /. If the remainder is zero, the process branches to S1911. If the remainder is 1, the process branches to S1912. If the remainder is 2, the process branches to S1913.
[0228] S1911では、時間情報 S611の上位 4バイトと、変数 ptrの示すアドレスのメモリの格納 値 4バイトとの排他的論理和をとり、 ptrの示すアドレスに格納している。  In S1911, the upper 4 bytes of time information S611 and the stored value 4 bytes of the memory at the address indicated by variable ptr are exclusive-ORed and stored in the address indicated by ptr.
[0229] S1912では、時間情報 S611の下位 4バイトと、変数 ptrの示すアドレスの 4バイトとの 排他的論理和をとり、 ptrの示すアドレスに格納して!/、る。 [0229] In S1912, an exclusive OR of the lower 4 bytes of the time information S611 and the 4 bytes of the address indicated by the variable ptr is taken and stored in the address indicated by ptr.
[0230] S1913では、 S612つまり 4バイトの連続番号と、変数 ptrの示すアドレスの 4バイトとの 排他的論理和をとり、 ptrの示すアドレスに格納して!/、る。 [0230] In S1913, the exclusive OR of S612, that is, the 4-byte serial number and the 4 bytes of the address indicated by the variable ptr is taken and stored in the address indicated by ptr! /.
[0231] 以上により、 12バイト(4バイト X 3)単位で力べ乱をかけている。この 12バイト単位の 力べ乱は時系列変化の中で重複のないかく乱を行うことが出来る。結果、乱数発生装 置が生成した乱数に対して、さらに 3バイト単位の間隔で重複のない乱数を生成する 事ができる。 [0231] As described above, power is disturbed in units of 12 bytes (4 bytes x 3). This twelve-byte unit force disturbance can be performed without any overlap in the time series. As a result, random numbers that do not overlap can be generated at intervals of 3 bytes for the random numbers generated by the random number generator.
図面の簡単な説明  Brief Description of Drawings
[0232] [図 1]擬似乱数の周期を示した説明図である。 [0232] [FIG. 1] An explanatory diagram showing a period of a pseudo-random number.
[図 2]データの暗号ィ匕を示した説明図である。 [図 3]実施例の物理的全体像を示した図である。 FIG. 2 is an explanatory diagram showing data encryption. FIG. 3 is a diagram showing a physical overview of the example.
[図 4]指紋認証記憶装置の説明を示した図である。  FIG. 4 is a diagram illustrating a fingerprint authentication storage device.
[図 5]n個の静的決定暗号鍵を説明した図である。  FIG. 5 is a diagram illustrating n statically determined encryption keys.
[図 6]動的暗号鍵の説明した図である。  FIG. 6 is a diagram illustrating a dynamic encryption key.
[図 7]実際の暗号ィ匕復号ィ匕の考え方を説明した図である。  FIG. 7 is a diagram for explaining the concept of actual encryption / decryption.
[図 8]暗号ィ匕復号ィ匕装置および関数 fの入出力を説明した図である。(実施例 1) FIG. 8 is a diagram for explaining the input / output of the encryption / decryption device and the function f. (Example 1)
[図 9]変換プログラムの処理を説明した図である。(実施例 1) FIG. 9 is a diagram for explaining processing of a conversion program. (Example 1)
[図 10]乱数表生成プログラムの入出力を表した説明図である。(実施例 1)  FIG. 10 is an explanatory diagram showing input / output of a random number table generation program. (Example 1)
[図 11]乱数表の発生プログラムを表した説明図である。(実施例 1)  FIG. 11 is an explanatory diagram showing a random number table generation program. (Example 1)
[図 12]固有機器のユニークコードを取得するプログラムの説明図である。  FIG. 12 is an explanatory diagram of a program for acquiring a unique code of a unique device.
[図 13]n個の乱数表による乱数表の合成を示した説明図である。  FIG. 13 is an explanatory diagram showing synthesis of a random number table using n random number tables.
[図 14]暗号ィ匕復号ィ匕プログラムの入出力を示した説明図である。(実施例 2) FIG. 14 is an explanatory diagram showing input / output of the encryption key decryption program. (Example 2)
[図 15]変換プログラムの流れを示した説明図である。(実施例 2) FIG. 15 is an explanatory diagram showing the flow of a conversion program. (Example 2)
[図 16]変換アプリケーションを示した説明図である。(実施例 3)  FIG. 16 is an explanatory diagram showing a conversion application. (Example 3)
[図 17]変換アプリケーションを示した説明図である。(実施例 4)  FIG. 17 is an explanatory diagram showing a conversion application. (Example 4)
[図 18]ホストとなる装置を示した説明図である。  FIG. 18 is an explanatory diagram showing a device as a host.
[図 19]S1116処理の実施例を示した説明図である。(実施例 5)  FIG. 19 is an explanatory diagram showing an example of S1116 processing. (Example 5)
符号の説明 Explanation of symbols
S1811…中央処理装置(CPU)。 S1811: Central processing unit (CPU).
S1812- --ROMBIOS0 S1812- --ROMBIOS 0
S1813' "メモリ装置。 S1813 '"Memory device.
S1814,S1817,S1818"'システムバス。 S1814, S1817, S1818 "'system bus.
S1815,S1816"'アダプタ。 S1815, S1816 "adapter.
S1820"'ホスト I/F。 S1820 "'Host I / F.
S1830"-HDD。 S1830 "-HDD.
S1819"'リーダライタ。 S1819 "'Reader / Writer.
S 1840· "USB装置。 S 1840 · “USB device.

Claims

請求の範囲 The scope of the claims
[1] コンピュータ処理による乱数表発生装置であって、  [1] A random number table generator by computer processing,
使用制限数 n(nは正数)以上の要素数力 なる乱数表を生成する手段と、 生成した乱数表を記憶する領域と、  Means for generating a random number table that has a power of more than the limit number n (n is a positive number), an area for storing the generated random number table,
前記使用制限数 nを記憶する領域と、  An area for storing the use limit number n;
前記乱数表の要素を前記使用制限数 nまで使用したとき当該乱数表の n+ 1以降 の要素を使用せずに別の乱数表を生成させる手段と、  Means for generating another random number table without using elements after n + 1 of the random number table when the random number table element is used up to the use limit number n;
を備えたことを特徴とする乱数表発生装置。  A random number table generator characterized by comprising:
[2] コンピュータ処理による乱数表発生装置であって、 [2] A random number generator for computer processing,
起源の異なる複数の暗号鍵を取得する手段と、  Means for obtaining a plurality of encryption keys of different origins;
前記起源の異なる複数の暗号鍵を記憶する領域と、  An area for storing a plurality of encryption keys of different origins;
前記起源の異なる複数の暗号鍵をシードとして一つの乱数表を生成する手段と、 前記乱数表を記憶する領域と、  Means for generating one random number table using a plurality of encryption keys of different origins as seeds; an area for storing the random number table;
を備えたことを特徴とする乱数表発生装置。  A random number table generator characterized by comprising:
[3] 前記乱数表発生装置は、メルセンヌ素数を使用した疑似乱数発生方式又はメルセ ンヌ 'ツイスタによる疑似乱数発生方式により前記乱数表を生成することを特徴とした 請求項 1又は 2に記載の乱数表発生装置。 [3] The random number table generation device according to claim 1 or 2, wherein the random number table generation device generates the random number table by a pseudo random number generation method using Mersenne prime numbers or a pseudo random number generation method by a Mersenne twister. Table generator.
[4] 前記暗号鍵の一つとして時間情報を含むことを特徴とした請求項 2に記載の乱数 表発生装置 4. The random number table generation device according to claim 2, wherein time information is included as one of the encryption keys.
[5] 請求項 4に記載の乱数表発生装置において、  [5] In the random number table generator according to claim 4,
前記乱数表と前記時間情報とを演算した結果を前記乱数表とする手段を備えたこ とを特徴とする乱数表発生装置。  A random number table generating device comprising means for calculating a result of calculating the random number table and the time information as the random number table.
[6] 前記暗号鍵の一つとして、前記乱数表発生装置としてのコンピュータシステムに接 続している機器の固有情報を含むことを特徴とした請求項 2記載の乱数表発生装置 6. The random number table generating device according to claim 2, wherein one of the encryption keys includes unique information of a device connected to a computer system as the random number table generating device.
[7] 前記暗号鍵の一つとして、前記乱数表発生装置としてのコンピュータシステム自体 の固有情報を含むことを特徴とした請求項 2記載の乱数表発生装置。 7. The random number table generating device according to claim 2, wherein one of the encryption keys includes unique information of the computer system itself as the random number table generating device.
[8] 前記コンピュータシステムの固有情報として、当該コンピュータシステムが内蔵する 記憶装置のシリアル番号を取得することを特徴とした請求項 11記載の乱数表発生装 置。 [8] Built into the computer system as unique information of the computer system 12. The random number table generation device according to claim 11, wherein the serial number of the storage device is acquired.
[9] 前記暗号鍵の一つとして、ユーザの生体情報を含むことを特徴とした請求項 2記載 の乱数表発生装置。  9. The random number table generator according to claim 2, wherein one of the encryption keys includes user biometric information.
[10] 前記暗号鍵の一つとして、入力装置力 入力された又は自動的に設定したキーヮ ードを含むことを特徴とした請求項 2記載の乱数表発生装置。  10. The random number table generator according to claim 2, wherein one of the encryption keys includes a keyword that is input or automatically set by an input device.
[11] 前記暗号鍵の一つとして、連続番号等のユニークコードを、前記生成する乱数表 毎に与える手段を備えたことを特徴とする請求項 2記載の乱数表発生装置。 11. The random number table generating apparatus according to claim 2, further comprising means for giving a unique code such as a serial number as one of the encryption keys for each of the generated random number tables.
[12] 請求項 1又は 2に記載の乱数表発生装置において、 [12] In the random number table generator according to claim 1 or 2,
前記乱数表を複数生成し当該複数の乱数表の要素を組み合わせることにより新た な乱数系列を生成する手段を備えたことを特徴とする乱数表発生装置。  A random number table generating apparatus comprising means for generating a plurality of random number tables and generating a new random number sequence by combining elements of the plurality of random number tables.
[13] 請求項 1乃至 12のいずれかの乱数表発生装置と、 [13] The random number table generator according to any one of claims 1 to 12,
暗号化又は復号化すべき情報を記憶する領域と、  An area for storing information to be encrypted or decrypted;
前記乱数表を用いて前記暗号化又は復号化すべき情報を暗号化又は復号化する 手段と、  Means for encrypting or decrypting the information to be encrypted or decrypted using the random number table;
前記暗号化又は復号化した情報を記憶する領域とを備え、  An area for storing the encrypted or decrypted information,
前記暗号化又は復号化する手段は、暗号化又は復号化すべき情報毎に、前記乱 数表発生装置力 異なるシードによる乱数表を個別に生成させ、最近に生成させた 乱数表を用いて暗号化又は復号化を行うことを特徴とした暗号化 Z復号化装置。  The means for encrypting or decrypting individually generates a random number table with different seeds for each information to be encrypted or decrypted, and encrypts it using a recently generated random number table. Or an encryption Z decryption device characterized by performing decryption.
[14] 請求項 4又は 5に記載の乱数表発生装置において、前記時間情報は、前記暗号化 又は復号ィ匕すべき情報に関連する時間情報とすることを特徴とした請求項 13に記載 の暗号化 Z復号化装置。 [14] The random number table generator according to [4] or [5], wherein the time information is time information related to the information to be encrypted or decrypted. Encryption Z decryption device.
[15] 請求項 13に記載の暗号化 Z復号化装置において、 [15] In the encryption Z decryption device according to claim 13,
暗号ィ匕した情報をコンピュータの基本制御ソフトが持つファイル管理システムにより ファイルとして記憶装置に保存させる手段と、  Means for storing the encrypted information in a storage device as a file by the file management system of the basic control software of the computer;
当該暗号ィ匕に用いた前記時間情報を当該ファイルの生成時間もしくは更新時間と して当該ファイルに保存させる手段とを備えたことを特徴とする暗号ィ匕 Z復号ィ匕装置 Means for storing the time information used for the encryption key in the file as a generation time or an update time of the file.
[16] 請求項 11に記載の乱数表発生装置において、前記ユニークコードとしてセクタ及 びブロック等の記憶装置の記録単位を指標する値を与えるものとし、 [16] In the random number table generator according to claim 11, a value indicating a recording unit of a storage device such as a sector and a block is given as the unique code.
ある記録単位に記録されている情報を暗号ィ匕又は復号ィ匕する際に用いる乱数表は 、その記録単位を指標する値を前記ユニークコードに与えて生成する手段を備えた ことを特徴とする請求項 13に記載の暗号ィ匕 Z復号ィ匕装置。  The random number table used when encrypting or decrypting information recorded in a certain recording unit is characterized by comprising means for generating the unique code by giving a value indicating the recording unit to the unique code. 14. The encryption key decryption device according to claim 13.
[17] 請求項 1乃至 16のいずれかの装置において、 [17] The device according to any one of claims 1 to 16,
前記各手段の動作をコンピュータに実行させるためのプログラム。  A program for causing a computer to execute the operation of each means.
[18] 請求項 17に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体。 18. A computer-readable recording medium on which the program according to claim 17 is recorded.
PCT/JP2007/063182 2006-06-30 2007-06-30 Random number generation device, encryption/decryption device using the same, its program, and program recording medium WO2008001918A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2006181941A JP2009258141A (en) 2006-06-30 2006-06-30 Infinite encryption/decryption device using infinite random number generation device and infinite encryption device
JP2006-181941 2006-06-30

Publications (1)

Publication Number Publication Date
WO2008001918A1 true WO2008001918A1 (en) 2008-01-03

Family

ID=38845678

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2007/063182 WO2008001918A1 (en) 2006-06-30 2007-06-30 Random number generation device, encryption/decryption device using the same, its program, and program recording medium

Country Status (2)

Country Link
JP (1) JP2009258141A (en)
WO (1) WO2008001918A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012514353A (en) * 2008-12-29 2012-06-21 ノーテル・ネットワークス・リミテッド Band-efficient method and system for hiding the presence of encryption in a communication channel
JP5556955B2 (en) * 2011-03-29 2014-07-23 富士通株式会社 Cryptographic processing apparatus, authentication method, and program
US8923513B2 (en) 2008-08-11 2014-12-30 Assa Abloy Ab Secure wiegand communications
JP2017156933A (en) * 2016-03-01 2017-09-07 マイクロメーション株式会社 Password setting method for information processing terminal
US10452877B2 (en) 2016-12-16 2019-10-22 Assa Abloy Ab Methods to combine and auto-configure wiegand and RS485
JP2020517209A (en) * 2017-04-17 2020-06-11 徐智能 Sequence encryption method for randomly reconstructing keys with ancillary and adjustable method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101818671B1 (en) 2011-04-19 2018-02-28 삼성전자주식회사 Nonvolatile memory device and nonvolatile memory system and random data read method thereof
KR102169556B1 (en) * 2018-10-26 2020-10-23 현대오토에버 주식회사 Apparatus for generating signature and system thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6410750A (en) * 1987-07-02 1989-01-13 Mitsubishi Electric Corp Block encipherment device
JPH0879236A (en) * 1994-09-09 1996-03-22 Mita Ind Co Ltd Communication equipment
JPH1145173A (en) * 1997-07-25 1999-02-16 L Ii Tec:Kk Random number generating device and microcomputer for game machine control
JP2005011356A (en) * 2003-06-21 2005-01-13 Samsung Electronics Co Ltd Method and system for generating random number in disk drive
JP2005063399A (en) * 2003-07-30 2005-03-10 Mieko Tsuyusaki File/key/data management system
WO2006121149A1 (en) * 2005-05-13 2006-11-16 Ochanomizu University Pseudo random number generation system, encryption system, and decryption system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6410750A (en) * 1987-07-02 1989-01-13 Mitsubishi Electric Corp Block encipherment device
JPH0879236A (en) * 1994-09-09 1996-03-22 Mita Ind Co Ltd Communication equipment
JPH1145173A (en) * 1997-07-25 1999-02-16 L Ii Tec:Kk Random number generating device and microcomputer for game machine control
JP2005011356A (en) * 2003-06-21 2005-01-13 Samsung Electronics Co Ltd Method and system for generating random number in disk drive
JP2005063399A (en) * 2003-07-30 2005-03-10 Mieko Tsuyusaki File/key/data management system
WO2006121149A1 (en) * 2005-05-13 2006-11-16 Ochanomizu University Pseudo random number generation system, encryption system, and decryption system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Snake Oil Warning Signs: Encryption Software to Avoid", 10 April 1998 (1998-04-10), XP003020314, Retrieved from the Internet <URL:http://www.interhack.net/people/cmcurtin/snake-oil-faq.ps> *
MAKATO MATSUMOTO ET AL.: "CRYPTOGRAPHIC MERSENNE TWISTER AND FUBUKI STREAM/BLOCK CIPHER", CRYPTOLOGY EPRINT ARCHIVE: REPORT 2005/165, 1 June 2005 (2005-06-01), XP003020313, Retrieved from the Internet <URL:http://www.eprint.iarcr.org/2005/165> *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8923513B2 (en) 2008-08-11 2014-12-30 Assa Abloy Ab Secure wiegand communications
US8943562B2 (en) 2008-08-11 2015-01-27 Assa Abloy Ab Secure Wiegand communications
JP2012514353A (en) * 2008-12-29 2012-06-21 ノーテル・ネットワークス・リミテッド Band-efficient method and system for hiding the presence of encryption in a communication channel
JP5556955B2 (en) * 2011-03-29 2014-07-23 富士通株式会社 Cryptographic processing apparatus, authentication method, and program
JP2017156933A (en) * 2016-03-01 2017-09-07 マイクロメーション株式会社 Password setting method for information processing terminal
US10452877B2 (en) 2016-12-16 2019-10-22 Assa Abloy Ab Methods to combine and auto-configure wiegand and RS485
JP2020517209A (en) * 2017-04-17 2020-06-11 徐智能 Sequence encryption method for randomly reconstructing keys with ancillary and adjustable method

Also Published As

Publication number Publication date
JP2009258141A (en) 2009-11-05

Similar Documents

Publication Publication Date Title
WO2008001918A1 (en) Random number generation device, encryption/decryption device using the same, its program, and program recording medium
KR100974973B1 (en) Accessing private data about the state of a data processing machine from storage that is publicly accessible
KR20090080032A (en) Method and system to provide security implementation for storage devices
JP5996777B2 (en) Code processing apparatus and program
US7818567B2 (en) Method for protecting security accounts manager (SAM) files within windows operating systems
US9076018B2 (en) Encryption key generation in encrypted storage devices
KR20070118589A (en) Method and system for microprocessor data security
CN103294969B (en) File system mounted method and device
JP2005303981A (en) Method and device for cryptographic conversion in data storage system
EP3844647B1 (en) System and method for providing protected data storage in data memory
US10972253B2 (en) Virtual enigma cipher
CN110046503B (en) Secure firmware provisioning and device binding mechanism
Birleanu et al. Reconfigurable computing in hardware security. A brief review and application
JP4351731B2 (en) Pseudorandom number generator, pseudorandom number generator program, and medium on which pseudorandom number generator program is recorded
KR101043255B1 (en) Usb hub device for providing datasecurity and method for providing datasecurity using the same
JP6205272B2 (en) Digital information protection method, apparatus, and computer-accessible recording medium
Alendal et al. got HW crypto? On the (in) security of a Self-Encrypting Drive series
US10860707B2 (en) Systems and methods for obfuscation of password key and dynamic key pool management
JP2008135893A (en) Encryption device and program for creating encrypted document attached with disposable encryption key
TW202226780A (en) Creating, using, and managing protected cryptography keys
WO2012087258A1 (en) Usb memory encryption device
US20200204339A1 (en) Portable electronic device and ic module
JP5539024B2 (en) Data encryption apparatus and control method thereof
Devaji et al. Performance Analysis of Secure Hash Algorithm-2 (SHA-) and Implementing on FPGA
JP4664655B2 (en) Information processing apparatus and address control method thereof

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: 07767963

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

NENP Non-entry into the national phase

Ref country code: RU

122 Ep: pct application non-entry in european phase

Ref document number: 07767963

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP