CN104486067B - A kind of method and device for generating fixed-length sequence number - Google Patents
A kind of method and device for generating fixed-length sequence number Download PDFInfo
- Publication number
- CN104486067B CN104486067B CN201410724761.1A CN201410724761A CN104486067B CN 104486067 B CN104486067 B CN 104486067B CN 201410724761 A CN201410724761 A CN 201410724761A CN 104486067 B CN104486067 B CN 104486067B
- Authority
- CN
- China
- Prior art keywords
- base32
- sequence number
- ciphertext
- sequence numbers
- codings
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 16
- 238000013478 data encryption standard Methods 0.000 claims abstract description 14
- 239000011159 matrix material Substances 0.000 claims description 2
- 238000012356 Product development Methods 0.000 abstract description 2
- 241001269238 Data Species 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000005266 casting Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
Landscapes
- Storage Device Security (AREA)
Abstract
The present invention discloses a kind of method and device for generating fixed-length sequence number, wherein method includes:Clear text serial number is encrypted by 26 ciphertext sequence numbers of generation by data encryption standards symmetric encipherment algorithm;26 ciphertext sequence numbers are encoded by Base32, and the information of one arranged in the Base32 codings of 26 ciphertext sequence numbers is carried on two arranged in the Base32 codings of other ciphertext sequence numbers, become the coding of 25 ciphertext sequence numbers.Technical scheme efficiency high, it is easily used and using the product development field for needing sequence number certification that extensively, can be applied to various software and hardwares correlations.
Description
Technical field
The present invention relates to software, the right-safeguarding technology of hardware development, more particularly to the method for generation fixed-length sequence number and
Device.
Background technology
Sequence number with regular length is conventional sequence number, is widely used in software and hardware production industry.Example
If software developer is in order to prevent piracy, certain safeguard measure can be taken software by sequence number.User's registration when
Unique identification code, commonly referred to as machine code can be generated according to the computer software and hardware information that user software is installed by waiting, and also be cried
Sequence number, authentication code, application for registration code etc..If sequence number is used to the 2nd people, then in sequence number by the 2nd checking
When, it finds that the physical address of network interface card when being verified for the first time first with it is different, will be by software developer
It was found that there is the same set of software of 2 personal uses, so as to which piracy will be become by the 2nd checking sequence number.Also one kind is to pass through this
The Disk Serial Number on ground passes through certain algorithm, formation sequence number so that and software can be installed by installing this computer of software first,
But other computers cannot just install the software.
The sequence number of 25 espespecially readily discernible regular lengths of sequence number with regular length, it is even more at present using high
A kind of pattern of the sequence number of effect.The sequence number of existing 25 regular lengths is usually to be generated with random device, rather than logical
Data encryption standards (DES, Data Encryption Standard) encryption is crossed, therefore safety coefficient is than relatively low.If moreover, will
For the sequence number of regular length by des encryption, caused cipher component row number length is 26, does not meet sequence number general at present
Pattern.
Accordingly, it is desirable to provide it is a kind of generate fixed-length sequence number method, sequence number can be encrypted with DES and
25 general sequence number patterns can be formed.
The content of the invention
The technical problems to be solved by the invention are to provide a kind of method and device for generating fixed-length sequence number, can
Generate the sequence number of 25 general bit sequence number patterns.
In order to solve the above-mentioned technical problem, the invention provides a kind of method for generating fixed-length sequence number, including:
Encrypting step:Clear text serial number is encrypted by 26 ciphertext sequences of generation by data encryption standards symmetric encipherment algorithm
Number;
Coding step:26 ciphertext sequence numbers are encoded by Base32, and by 26 ciphertext sequence numbers
The information of one arranged in Base32 codings is carried on two arranged in the Base32 codings of other ciphertext sequence numbers, is become
Into the coding of 25 ciphertext sequence numbers.
Further, also include before the coding step:
The two Base32 codings set for carrying Hidden Codes information are respectively the last position Z of letter and the last position 8 of numeral, and are set
The fixed divisor that acquisition quotient and the remainder are encoded with Base32 is 6;The position for concurrently setting Hidden Codes is 26 ciphertext sequence numbers
Last position in Base32 codings.
Further, the coding step specifically includes:
Sequence number of the character value of the last position in Base32 codings in Base32 is obtained, with the sequence number divided by the divisor of setting
6, obtain quotient and the remainder;The lowercase letter in abcdef is found by the use of gained business as the first guiding sequence number to carry on Z
Information, the information on 8 is carried by the use of the lowercase letter that gained remainder is found in hijklmn as the second guiding sequence number,
So as to which the coding of 26 ciphertext sequence numbers to be changed into the coding of 25 ciphertext sequence numbers.
In order to solve the above-mentioned technical problem, the invention provides a kind of device for generating fixed-length sequence number, including according to
Des encryption module, Base32 coding modules and the sequence number of secondary connection condense module, wherein:
Des encryption module, for clear text serial number encryption to be generated into 26 by data encryption standards symmetric encipherment algorithm
Ciphertext sequence number;
Base32 coding modules, for encoding 26 ciphertext sequence numbers by Base32;
Sequence number condenses module, for the information of one arranged in the Base32 codings of 26 ciphertext sequence numbers to be carried
On two arranged in the Base32 codings of other ciphertext sequence numbers, become the Base32 codings of 25 ciphertext sequence numbers.
Further, two Base32 that Base32 coding modules are preset for carrying Hidden Codes information encode difference
For the last position Z of letter and the last position 8 of numeral, and set the divisor with Base32 coding acquisition quotient and the remainder as 6;Concurrently set Hidden Codes
Position be the last position in the Base32 codings of 26 ciphertext sequence numbers.
Further, the sequence number module that condenses obtains sequence of the character value in Base32 of the last position in Base32 codings
Number, with the sequence number divided by the divisor of setting 6, obtain quotient and the remainder;Found by the use of gained business as the first guiding sequence number in abcdef
Lowercase letter carries the information on Z, and the small letter in hijklmn is found by the use of gained remainder as the second guiding sequence number
Matrix shows the information carried on 8, so as to which the coding of 26 ciphertext sequence numbers to be changed into the coding of 25 ciphertext sequence numbers.
The present invention is to produce to have fixed-length sequence number based on DES.Because DES is that conventional and safe encryption and decryption is calculated
Method, it is then of the invention by being assigned in the character string crossed by des encryption to agreement character (for example trailing character or initial character),
26 potential source ciphertexts can be shortened to 25 in the state of it need to only consume minimum computing resource, and also can Quick Casting ciphertext word
Symbol string, 25 bit sequence number ciphertexts are restored to the source ciphertext of 26 bit sequence numbers.Technical scheme efficiency high, it is easily used
And application is wide, the related product development field for needing sequence number certification of various software and hardwares can be applied to.
Brief description of the drawings
Fig. 1 is the flow chart of the embodiment of the method for the generation fixed-length sequence number of the present invention;
Fig. 2 is the structured flowchart of the device embodiment of the generation fixed-length sequence number of the present invention.
Embodiment
Technical scheme is set forth in below in conjunction with accompanying drawing and preferred embodiment.It should be understood that with
Under the embodiment enumerated be merely to illustrate and explain the present invention, without forming the limitation to technical solution of the present invention.
As shown in figure 1, the flow of the embodiment of the method for the generation fixed-length sequence number of the present invention is illustrated, including step
Suddenly:
110:Clear text serial number is encrypted by 26 ciphertext sequence numbers of generation by DES symmetric encipherment algorithms;
120:26 ciphertext sequence numbers are encoded by Base32, and by the Base32 codings of 26 ciphertext sequence numbers about
The fixed information of one is carried on two arranged in the Base32 codings of other ciphertext sequence numbers, becomes 25 ciphertext sequences
Number coding.
In above method embodiment,
Preset for the two Base32 codings respectively last position Z of letter for carrying Hidden Codes information and the last position 8 of numeral,
And set and encode the divisor for obtaining quotient and the remainder as 6 with Base32;The position for concurrently setting Hidden Codes is 26 ciphertext sequence numbers
Last position in Base32 codings.
For example, clear text serial number is encrypted into 26 ciphertext sequence numbers of generation by DES symmetric encipherment algorithms, then pass through
Base32 (ABCDEFGHIJKLMNOPQRSTUVWXYZ345678) encodes 26 ciphertext Serial No. JHEVM-254ZX-
V7R82-CJMV7-HUXCU-7;Wherein last bit value is character " 7 ", and its sequence number in Base32 is 31, with 31 divided by
The divisor 6 of setting, it is 5 to obtain business, and remainder is 1.
Define extra lowercase abcdef to represent to carry the information on Z, i.e., the letter of business 5 is carried with Z+5 → e
Breath;It is to carry the number on 8 to re-define extra hijklmn, i.e., the information of remainder 1 is carried with 8+1 → h;Through so handling,
Ciphertext sequence number is changed into:JHEVM-254eX-V7Rh2-CJMV7-HUXCU, then by last character " 7 " with it in Base32
In sequence number 31 divided by 6 business 5 and remainder 1 carry respectively on lowercase e and h.
Changed more than, the Base32 coded datas of the ciphertext sequence number after des encryption can be treated as 25
The Base32 codings of ciphertext sequence number.
In above method embodiment,
, will be wherein non-when the Base32 codings of ciphertext sequence number are decoded
ABCDEFGHIJKLMNOPQRSTUVWXYZ345678's finds out, i.e. character " e " and character " h ", and " e " and " h " is right respectively
The position 5 and 1 answered reverts to predetermined Z and 8, while obtains the remainder 1 of business 5, and obtains Base32 codings according to predetermined divisor 6
Sequence number 31, final 26 ciphertext sequence numbers for obtaining JHEVM-254ZX-V7R82-CJMV7-HUXCU-7.
Certainly, preset for the two Base32 codings for carrying Hidden Codes information except be respectively the last position Z of letter and
Outside the last position 8 of numeral, the penultimate position Y of letter and the penultimate position 7 of numeral are also may be set to, or is set as alphabetical penultimate position X and numeral
Penultimate position 6 ... ....The divisor for obtaining quotient and the remainder is encoded in addition to 6 with Base32 except setting, and also may be set to 5,
4 ... ....Set the positions of Hidden Codes as outside the last position in the Base32 codings of 26 ciphertext sequence numbers, can also set Hidden Codes it
Position is the first place in the Base32 codings of 26 ciphertext sequence numbers, or sets the positions of Hidden Codes as 26 ciphertext sequence numbers
Penultimate position ... in Base32 codings etc..
The present invention is directed to above method embodiment, and the device for correspondingly additionally providing generation fixed-length sequence number is implemented
Example, its structure mould as shown in Fig. 2 des encryption module, Base32 coding modules and sequence number including being sequentially connected condense
Block, wherein:
Des encryption module, for clear text serial number to be encrypted into 26 ciphertext sequences of generation by DES symmetric encipherment algorithms
Number;
Base32 coding modules, for encoding 26 ciphertext sequence numbers by Base32;
Sequence number condenses module, for the information of one arranged in the Base32 codings of 26 ciphertext sequence numbers to be carried
On two arranged in the Base32 codings of other ciphertext sequence numbers, become the coding of 25 ciphertext sequence numbers.
In said apparatus embodiment,
Two Base32 codings that Base32 coding modules preset for carrying Hidden Codes information are respectively letter end
Position Z and the last position 8 of numeral, and set and encode the divisor for obtaining quotient and the remainder as 6 with Base32;The position for concurrently setting Hidden Codes is 26
Last position in the Base32 codings of position ciphertext sequence number.
In said apparatus embodiment,
The sequence number module that condenses obtains sequence number of the character value in Base32 of the last position in Base32 codings, with the sequence number
Divided by the divisor 6 of setting, obtain quotient and the remainder;The lowercase letter in abcdef is found by the use of gained business as guiding sequence number 1 to take
The information being loaded on Z, find the lowercase letter in hijklmn as guiding sequence number 2 by the use of gained remainder and carry on 8
Information, so as to which the coding of 26 ciphertext sequence numbers to be changed into the codings of 25 ciphertext sequence numbers.
Claims (4)
1. a kind of method for generating fixed-length sequence number, including:
Encrypting step:Clear text serial number is encrypted by 26 ciphertext sequence numbers of generation by data encryption standards symmetric encipherment algorithm;
Coding step:26 ciphertext sequence numbers are encoded by Base32, and the Base32 of 26 ciphertext sequence numbers is compiled
The information of one arranged is carried on two arranged in the Base32 codings of other ciphertext sequence numbers in code, become 25 it is close
The coding of literary sequence number;
Wherein, the coding step specifically includes:
Sequence number of the character value of the last position in Base32 codings in Base32 is obtained, with the sequence number divided by the divisor of setting 6, is obtained
Quotient and the remainder;The information on Z is carried by the use of the lowercase letter that gained business is found in abcdef as the first guiding sequence number,
The information on 8 is carried by the use of the lowercase letter that gained remainder is found in hijklmn as the second guiding sequence number, so that will
The coding of 26 ciphertext sequence numbers is changed into the coding of 25 ciphertext sequence numbers.
2. in accordance with the method for claim 1, it is characterised in that also include before the coding step:
The two Base32 codings set for carrying Hidden Codes information are respectively the last position Z of letter and the last position 8 of numeral, and set use
The divisor that Base32 codings obtain quotient and the remainder is 6;Compiled for the Base32 of 26 ciphertext sequence numbers the position for concurrently setting Hidden Codes
Last position in code.
3. it is a kind of generate fixed-length sequence number device, it is characterised in that including be sequentially connected des encryption module,
Base32 coding modules and sequence number condense module, wherein:
Des encryption module, for clear text serial number to be encrypted into 26 ciphertexts of generation by data encryption standards symmetric encipherment algorithm
Sequence number;
Base32 coding modules, for encoding 26 ciphertext sequence numbers by Base32;
Sequence number condenses module, for the information of one arranged in the Base32 codings of 26 ciphertext sequence numbers to be carried at it
On two arranged in the Base32 codings of its ciphertext sequence number, become the Base32 codings of 25 ciphertext sequence numbers;
Wherein, the sequence number module that condenses obtains sequence number of the character value in Base32 of the last position in Base32 codings, uses
The sequence number divided by the divisor of setting 6, obtain quotient and the remainder;The small letter in abcdef is found by the use of gained business as the first guiding sequence number
Matrix shows the information carried on Z, and the lowercase letter in hijklmn is found by the use of gained remainder as the second guiding sequence number
The information on 8 is carried, so as to which the coding of 26 ciphertext sequence numbers to be changed into the coding of 25 ciphertext sequence numbers.
4. according to the device described in claim 3, it is characterised in that
Two Base32 codings that the Base32 coding modules preset for carrying Hidden Codes information are respectively letter end
Position Z and the last position 8 of numeral, and set and encode the divisor for obtaining quotient and the remainder as 6 with Base32;The position for concurrently setting Hidden Codes is 26
Last position in the Base32 codings of position ciphertext sequence number.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410724761.1A CN104486067B (en) | 2014-12-02 | 2014-12-02 | A kind of method and device for generating fixed-length sequence number |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410724761.1A CN104486067B (en) | 2014-12-02 | 2014-12-02 | A kind of method and device for generating fixed-length sequence number |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104486067A CN104486067A (en) | 2015-04-01 |
CN104486067B true CN104486067B (en) | 2017-12-19 |
Family
ID=52760575
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410724761.1A Active CN104486067B (en) | 2014-12-02 | 2014-12-02 | A kind of method and device for generating fixed-length sequence number |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104486067B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1459724A (en) * | 2002-05-25 | 2003-12-03 | 三星电子株式会社 | Method and apparatus for producing sequence number |
CN101420231A (en) * | 2007-10-25 | 2009-04-29 | 索尼株式会社 | Encoding method and device, and program |
CN103023641A (en) * | 2012-10-25 | 2013-04-03 | 浪潮电子信息产业股份有限公司 | Serial number generating/verifying method |
CN103093129A (en) * | 2013-01-09 | 2013-05-08 | 上海大唐移动通信设备有限公司 | Registration code generation method and device used for software licensing |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8321657B2 (en) * | 2009-10-16 | 2012-11-27 | Dell Products L.P. | System and method for BIOS and controller communication |
-
2014
- 2014-12-02 CN CN201410724761.1A patent/CN104486067B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1459724A (en) * | 2002-05-25 | 2003-12-03 | 三星电子株式会社 | Method and apparatus for producing sequence number |
CN101420231A (en) * | 2007-10-25 | 2009-04-29 | 索尼株式会社 | Encoding method and device, and program |
CN103023641A (en) * | 2012-10-25 | 2013-04-03 | 浪潮电子信息产业股份有限公司 | Serial number generating/verifying method |
CN103093129A (en) * | 2013-01-09 | 2013-05-08 | 上海大唐移动通信设备有限公司 | Registration code generation method and device used for software licensing |
Non-Patent Citations (2)
Title |
---|
基于模运算的图像隐写算法;康辉等;《计算机应用与软件》;20070813;摘要、引言、第2.2节第1段 * |
现代密码学算法在软件序列号保护系统中的应用研究;姜浩;《中国优秀硕士学位论文全文数据库信息科技辑》;20080515;论文第8、44页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104486067A (en) | 2015-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Satir et al. | A compression-based text steganography method | |
CN103049682B (en) | Character pitch encoding-based dual-watermark embedded text watermarking method | |
CN106650869B (en) | Information hiding method based on two-dimensional code | |
CN110663215B (en) | Elliptic curve point multiplication device and method in white-box scene | |
CN110457873B (en) | Watermark embedding and detecting method and device | |
CN106612172A (en) | Data change recovery algorithm capable of restoring data authenticity in cloud storage | |
CN108830096B (en) | Data processing method and device, electronic equipment and storage medium | |
CN115941189B (en) | Encryption method for document data | |
CN105095699A (en) | Watermark information embedding method and device, and watermark information decoding method | |
CN104518865B (en) | A kind of data ciphering method based on code book | |
Immler et al. | Practical aspects of quantization and tamper-sensitivity for physically obfuscated keys | |
CN112016061A (en) | Excel document data protection method based on robust watermarking technology | |
CN105282090A (en) | Public URL encryption coding method for preventing illegal access on internet | |
CN106375083A (en) | Encryption-decryption method based on Base64 and device thereof | |
Alsaffar et al. | An encryption based on DNA and AES algorithms for hiding a compressed text in colored Image | |
Elmahi et al. | Text steganography using compression and random number generators | |
CN109412791B (en) | Key information processing method, device, electronic equipment and computer-readable medium | |
Baawi et al. | Enhancement of text steganography technique using Lempel-Ziv-Welch Algorithm and two-letter word technique | |
CN103632070B (en) | Any handwriting graphical password method used for payment system | |
CN104486067B (en) | A kind of method and device for generating fixed-length sequence number | |
CN104393988B (en) | A kind of reversible data ciphering method and device | |
CN110990846A (en) | Information storage method, device and computer readable storage medium | |
CN110784313A (en) | Key protection method, device and storage medium | |
CN116664123A (en) | Digital wallet design method based on blockchain technology | |
Fahrianto et al. | Encrypted SMS application on Android with combination of caesar cipher and vigenere algorithm |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |