WO2011050624A1 - 数据变换方法及装置 - Google Patents

数据变换方法及装置 Download PDF

Info

Publication number
WO2011050624A1
WO2011050624A1 PCT/CN2010/074598 CN2010074598W WO2011050624A1 WO 2011050624 A1 WO2011050624 A1 WO 2011050624A1 CN 2010074598 W CN2010074598 W CN 2010074598W WO 2011050624 A1 WO2011050624 A1 WO 2011050624A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
transformed
length
decimal
offset
Prior art date
Application number
PCT/CN2010/074598
Other languages
English (en)
French (fr)
Inventor
陆舟
于华章
Original Assignee
北京飞天诚信科技有限公司
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 北京飞天诚信科技有限公司 filed Critical 北京飞天诚信科技有限公司
Priority to US12/811,468 priority Critical patent/US8655932B2/en
Publication of WO2011050624A1 publication Critical patent/WO2011050624A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions

Definitions

  • the present invention relates to the field of data processing algorithms, and more particularly to data conversion methods and apparatus.
  • BACKGROUND When using various computer networks, various methods are needed to ensure network security, for example: calculating a message digest to ensure message integrity, or verifying a password input by a user to ensure a user Legitimacy.
  • the application principle of the message digest is as follows: The sender of the message calculates the message digest by using a one-way hash function, and then sends the message digest to the receiver simultaneously, and the receiver is After receiving the message, the message digest is calculated in the same way as the message sender.
  • the message digest is compared to the received message digest to see if the message has been tampered with. Therefore, the message digest guarantees the integrity of the message.
  • a one-way hash function is used to calculate a series of message digests from the messages that need to be sent. This string of message digests is also called digital fingerprint (Finger Print); the message digest has a fixed data length and different messages. The resulting message digest is always different, and the same message is consistently consistent with the message digest. Therefore, the message digest verifies that the received message is complete and correct.
  • the principle of password verification is as follows: First, a password is generated by a string of randomly generated numbers or symbols, the password is outputted as a picture, and some interference elements are added to the picture, and the password in the picture is visually recognized by the user. The information, and the password input form is submitted, the server verifies the password entered by the user, and the function provided by the server can be used after the verification is successful.
  • the inventors have found that at least the following problems exist in the prior art: in both of the above technologies, it is necessary to use some data to transform into another data, for example: Message digest, generating passwords from random numbers or symbols; different data transformation methods are currently used in each scheme, and the respective transformation methods are more complicated.
  • a data conversion method comprising: acquiring an offset from a predetermined position of a data string to be transformed; and acquiring a predetermined data from the data string to be transformed according to the offset Data of the number of bits; converting the acquired data into decimal data; determining whether the length of the decimal data is less than a first predetermined length; if the length of the decimal data is not less than a first predetermined length, from the decimal data The lower bit starts to continuously take the data of the first predetermined length as the transformed data; if the length of the decimal data is less than the first predetermined length, the high bit of the decimal data is zero-padded to the first predetermined length, and the high bit is zero-padded The latter data is used as the transformed data.
  • a data conversion apparatus comprising: a first acquiring unit, configured to acquire an offset from a predetermined position of a data string to be transformed; and a second acquiring unit, configured to obtain, according to the offset, a data string to be transformed a data of a predetermined number of bits; a transform unit, configured to convert the acquired data into decimal data; a determining unit, configured to determine whether a length of the decimal data is less than a first predetermined length; and an output unit, configured to: When the length of the decimal data is not less than the first predetermined length, the data of the first predetermined length is continuously taken as the transformed data from the lower bits of the decimal data; when the length of the decimal data is less than the first predetermined length, the decimal is performed.
  • the upper bits of the data are zero-padded to the first predetermined length, and the data after the high-order zero is used as the transformed data.
  • the data conversion method and apparatus provided by the present invention extracts a continuous predetermined number of bits from a data string to be transformed; then, the offset is calculated by the extracted bits, and is to be transformed according to the offset Data of a predetermined number of bits is obtained in the data string; and the extracted characters are transformed Decimal data, and finally only one data of the first predetermined length is output as the transformed data.
  • the invention can only take the data of the first predetermined length when the length of the converted decimal data is sufficient; when the length of the decimal data is not enough, the decimal data is padded to the first predetermined length; thereby realizing the final result length It is unified.
  • FIG. 1 is a flowchart of a data conversion method according to an embodiment of the present invention
  • FIG. 2 is a block diagram of a data conversion apparatus according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a data conversion method according to Embodiment 1 of the present invention
  • 2 is a flowchart of a data conversion method
  • FIG. 5 is a block diagram of a data conversion device in Embodiment 3 of the present invention.
  • the embodiment of the invention provides a data transformation method. As shown in FIG. 1 , the method includes:
  • the data string to be transformed in this process may be: random data directly input by the user, or Data obtained after transformation by a collision-free one-way algorithm;
  • the data of the predetermined number of bits may be obtained from the data string to be transformed according to the offset.
  • the predetermined number of bits in the embodiment of the present invention may be different according to the length of the data string to be transformed.
  • Performing corresponding adjustments; 103, converting the obtained predetermined number of bits of data into decimal data, and the specific transformation method may use an existing operation method, such as a binary to decimal method, and a hexadecimal to decimal method;
  • the embodiment of the present invention further provides a data conversion device. As shown in FIG. 2, the device includes: a first obtaining unit 21, a second obtaining unit 22, a transforming unit 23, a determining unit 24, and an output unit 25.
  • the first acquiring unit 21 is configured to obtain an offset from a predetermined position of the data string to be transformed, and the data string to be transformed may be: random data directly input by the user, The data obtained by the collision-free one-way algorithm may be used; the second obtaining unit 22 is configured to obtain data of a predetermined number of bits from the data string to be transformed according to the offset; and the transform unit 23 is configured to acquire the data.
  • the data is converted into decimal data; the determining unit 24 is configured to determine whether the length of the decimal data is less than a first predetermined length; and the output unit 25 is configured to: when the length of the decimal data is not less than a first predetermined length, from the decimal The lower bits of the data start to continuously take the data of the first predetermined length as the transformed data; when the length of the decimal data is less than the first predetermined length, the high bits of the decimal data are zero-padded to the first predetermined length, and the high bits are The zero-padded data is used as the transformed data.
  • the data conversion method and apparatus extracts a continuous predetermined number of bits from the data string to be transformed; and then calculates the offset by using the extracted bits, and according to The offset obtains data of a predetermined number of bits from the data string to be transformed; then transforms the extracted characters to obtain decimal data, and finally outputs only a data of a first predetermined length as the transformed data.
  • the length of the converted decimal data when the length of the converted decimal data is sufficient, only the data of the first predetermined length may be taken; when the length of the decimal data is insufficient, the decimal data is padded to the first predetermined length; thereby achieving the final obtained The length of the result is uniform.
  • Embodiment 1 As shown in FIG. 3, an embodiment of the present invention provides a data conversion method, which is a hexadecimal data string to be transformed.
  • the predetermined position may be a data string to be transformed.
  • the predetermined position may also take any position in the middle of the transformed data string, for example, the middle position of the data string to be transformed, and the third position. At a length, or a specific location such as the second, third byte, and so on.
  • the first byte of the transformed data string is taken as an offset, that is, the offset obtained in this example is “0x3A”; of course, in some cases, for example: the data string to be transformed
  • the length is known and the length is short.
  • the embodiment of the present invention may further preprocess the data string to be transformed before the 301, and the preprocessing is to process the data string to be transformed by a collision-free one-way algorithm.
  • the collision-free one-way algorithm in the embodiment is a hash algorithm or a message-risk code algorithm (HMAC), for example, a hash algorithm such as SHA-1. 302.
  • the process determines whether the offset exceeds the length of the data string to be transformed, if the offset Exceeding the length of the data string to be transformed, indicating that the offset is out of bounds, executing 303; if the offset does not exceed the length of the data string to be transformed, indicating that the offset is not out of bounds, performing 304; in this step, determining the offset
  • the specific method of whether the length of the data string is exceeded may be: converting the obtained offset into decimal data, the decimal data is compared with the length of the data string to be transformed, and if the decimal data is larger than the length of the data string to be transformed, the offset is considered
  • the acquired offset "0x3A" corresponds to a decimal data of 58, and the length of the data string to be transformed is 25, and the decimal data is larger than the length of the data string to
  • the decimal data obtained in 302 is 58.
  • the offset obtained is 0x08.
  • the offset is calculated as a new offset, in actual operation.
  • the bit that is taken out from the data string to be transformed may be directly used as an offset, and the taken bit may be 8 bits, 4 bits, or other number of bits;
  • the predetermined number of bits may be determined according to the length of the data string to be transformed.
  • the predetermined number of bits is 15 bits as an example, and the length of the int type is matched by the 15 bits; the predetermined number of bits can be obtained from the case where the offset obtained is 0x08.
  • the data is specifically "0xlD7F";
  • the 306. Determine whether the length of the decimal data is less than a first predetermined length. If the length of the decimal data is not less than a first predetermined length, perform a 307 process. If the length of the decimal data is less than a first predetermined length, execute 308 process; in this embodiment, the first predetermined length is 4, which is equal to the length of the calculated decimal number 7551 in 305, so the 307 process can be performed in this embodiment;
  • the zero bit of the decimal data is zero-padded to a first predetermined length, and the data after the high-order zero-padding is used as the transformed data; the process is that after the acquired predetermined number of bits of data is converted to decimal, less than four digits. , the high bit is zero, so that it is complemented by four bits; after the four bits of data are complemented, the zero padded data is used as the transformed data.
  • the data conversion method and apparatus extracts a continuous predetermined number of bits from a data string to be transformed; and then calculates an offset by using the extracted bit, and according to the offset
  • the data of the predetermined number of bits is obtained in the data string to be transformed; the extracted characters are transformed to obtain decimal data, and finally only one data of the first predetermined length is output as the transformed data.
  • the length of the converted decimal data when the length of the converted decimal data is sufficient, only the data of the first predetermined length may be taken; when the length of the decimal data is insufficient, the decimal data is padded to the first predetermined length; thereby achieving the final obtained The length of the result is uniform.
  • Embodiment 2 This embodiment provides a data conversion method.
  • a data string to be transformed is regarded as a large number of specified bytes, and is performed in the form of BIG-ENDIAN (lowest address storage most significant byte). storage.
  • the data string to be transformed needs to be converted into a 6-digit character, wherein the hexadecimal of the data string to be transformed is:
  • the data to be converted includes 20 bytes. If the length of the data string to be transformed needs to be fixed to 20 bytes, but the originally provided data string to be transformed is not 20 bytes, the embodiment of the present invention can preprocess it, such as: complement, truncation, etc., and finally obtain 20 bytes of data.
  • the pre-processing is to process the data string to be transformed by a collision-free one-way algorithm.
  • the collision-free one-way algorithm in this embodiment is a hash algorithm or a message-risk code algorithm (HMAC), for example: SHA-1 Wait for the hash algorithm.
  • HMAC message-risk code algorithm
  • the data transformation method corresponding to the embodiment of the present invention includes the following process:
  • the offset Take a predetermined number of bits from a predetermined position in the data string to be transformed as an offset.
  • the least significant four bits (in binary calculation) of the data string to be converted are taken as an offset, specifically It is "OxOB"; in this embodiment, the offset is obtained in a relatively simple manner, and the offset can be obtained in the manner provided in Embodiment 1 in actual application, which is not mentioned here;
  • the data of the predetermined number of bits is obtained starting from the lowest bit of the data string to be transformed after the right shift. If the predetermined number of bits in the embodiment refers to 31 bits, the data string to be transformed after the right shift in this embodiment.
  • the data of the lowest bit in sequence is: 0x24 AF315C;
  • the specific implementation method of this step can be used but is not limited to the following methods: Let the data string after arithmetic right shift be RESULT1, and the least effective 31 bit data be RESULT2, the following code gives Specific acquisition methods:
  • RESULT2 RESULT 1 &0x7FFFFFFF;
  • the fourth predetermined length is 6, which is less than the length of the calculated decimal number 615461212 in the 405, so the 407 process can be performed in this embodiment;
  • the software product provided in this embodiment includes, but is not limited to, a software product, which is implemented by a software product and a hardware. The next implementation:
  • Otp otp % digit_power [digit] ; ⁇ Generate the value according to the set number of digits
  • the data conversion method and device provided by the embodiment of the present invention are taken out continuously from the data string to be transformed. a predetermined number of bits; then, by using the extracted bits, an offset can be calculated, and data of a predetermined number of bits is obtained from the data string to be transformed according to the offset; and the extracted characters are transformed Decimal data, and finally only one data of the first predetermined length is output as the transformed data.
  • the length of the converted decimal data when the length of the converted decimal data is sufficient, only the data of the first predetermined length may be taken; when the length of the decimal data is insufficient, the decimal data is padded to the first predetermined length; thereby achieving the final obtained The length of the result is uniform.
  • Embodiment 3 The embodiment of the present invention further provides a data conversion apparatus. As shown in FIG.
  • the apparatus includes: a first obtaining unit 51, a second obtaining unit 52, a transforming unit 53, a determining unit 54, and an output unit 55.
  • the first acquiring unit 51 is configured to obtain an offset from a predetermined position of the data string to be transformed, and the data string to be transformed may be: random data directly input by the user, The data obtained by the non-collision unidirectional algorithm may be used; the second obtaining unit 52 is configured to obtain data of a predetermined number of bits from the data string to be transformed according to the offset; and the transform unit 53 is configured to acquire the data.
  • the data is converted into decimal data; the determining unit 54 is configured to determine whether the length of the decimal data is less than a first predetermined length; and the output unit 55 is configured to: when the length of the decimal data is not less than a first predetermined length, from the decimal The lower bits of the data start to continuously take the data of the first predetermined length as the transformed data; when the length of the decimal data is less than the first predetermined length, the high bits of the decimal data are zero-padded to the first predetermined length, and the high bits are The zero-padded data is used as the transformed data.
  • the first acquiring unit 51 may obtain the first byte, the middle any byte, or the last byte of the data string to be transformed when acquiring the offset; specifically, the foregoing An obtaining unit 51 includes: a first acquiring module 511, a determining module 512, and an output module 513.
  • the first obtaining module 511 is configured to extract 4 bits or 8 bits from the corresponding position corresponding byte of the data string to be transformed; the determining module 512 is configured to determine whether the decimal number corresponding to the extracted bit exceeds the data string to be transformed.
  • the output module 513 is configured to: when the decimal number corresponding to the extracted bit does not exceed the length of the data string to be converted, the decimal number corresponding to the extracted bit is used as an offset; the decimal number corresponding to the extracted bit exceeds When the length of the data string is changed, the decimal number corresponding to the extracted bit is divided by the remainder of the length of the data string to be transformed as an offset, or the decimal number corresponding to the extracted bit is subtracted by an integer multiple of the length of the data string to be transformed. As an offset.
  • the first obtaining unit 51 directly extracts 4 bits from the corresponding position corresponding byte of the data string to be transformed, since the 4 bits correspond to a decimal number of at most 15, the length of the data string to be transformed is long enough. In this case, the decimal number corresponding to the extracted bit can be directly used as the offset, and the offset will not be out of bounds.
  • the specific implementation manner of the second obtaining unit 52 in the embodiment of the present invention includes, but is not limited to, the following solutions: First, the second obtaining unit 52 is configured to obtain, at a position corresponding to the offset, a data string to be transformed. The number of predetermined digits.
  • the second acquiring unit 52 includes: a calculating module 521, a right shifting module 522, and a second acquiring module 223.
  • the right shift module 522 is configured to perform the arithmetic right shift on the data string to be transformed according to the arithmetic right shift number;
  • the second acquisition module 523 is used to The lowest bit of the shifted data string to be acquired starts to acquire data of a predetermined number of bits.
  • the embodiments of the present invention are mainly used in various devices and methods that require data transformation, such as: a dynamic password generation process and a device.
  • a dynamic password generation process and a device.
  • the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation.
  • the computer software product of the present invention is stored in a readable storage medium, such as a floppy disk, a hard disk or a disk of a computer. Etc., including thousands of instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

据变换方法^ ^置 技术领域 本发明涉及数据的处理算法领域, 尤其涉及数据变换方法及装置。 背景技术 在使用各种计算机网络的时候, 需要釆用各种方式保证网络安全, 例如: 对计算出消息摘要 ( Message Digest )以保证消息的完整性, 或者对用户输入 的口令进行验证以确保用户的合法性。 其中消息摘要应用原理为: 消息发送方通过单向 Hash (哈希)加密函数 对需要发送的消息进行计算得出消息摘要, 然后将消息和计算出的消息摘要 同时发送给接收方, 接收方在接收到消息后按照消息发送方相同的方法计算 出消息摘要, 如果消息在发送的途中被篡改, 那么计算出的消息摘要和接收 到的消息摘要是不会相同的; 接收方只需要将计算出的消息摘要与接收到的 消息摘要进行比较就可知道消息是否被篡改了。 因此消息摘要保证了消息的 完整性。 该方案中釆用单向 Hash 函数从需要发送的消息中计算出一串消息 摘要, 这一串消息摘要亦称为数字指紋 (Finger Print); 消息摘要的数据长度 是固定的, 并且不同的消息得到的消息摘要总是不同的, 而同样的消息多次 得到消息摘要必定一致。故而, 消息摘要可验证所接收的消息是否完整正确。 进行口令验证的原理为: 首先需要通过一串随机产生的数字或符号生成 口令, 将该口令以一幅图片的形式输出, 并在图片里加上一些千扰元素, 由 用户肉眼识别图片中的口令信息, 并将口令输入表单提交, 服务器对用户输 入的口令进行验证, 在验证成功后才能使用服务器提供的功能。 在实现上述消息摘要或口令验证的过程中, 发明人发现现有技术中至少 存在如下问题:在上述两项技术中都需要利用某种数据变换成另外一种数据, 例如: 从消息中转换出消息摘要, 从随机数字或符号中生成口令; 目前各个 方案中都釆用了不同的数据变换方法, 并且各自的变换方法比较复杂。 发明内容 本发明提供一种数据变换方法及装置, 使得数据变换方法较为简单。 为达到上述目的, 本发明釆用如下技术方案: 一种数据变换方法, 包括: 从待变换数据串的预定位置获取偏移量; 才艮据所述偏移量从待变换数据串中获取预定位数的数据; 将所获取的数据变换为十进制数据; 判断所述十进制数据的长度是否小于第一预定长度; 如果所述十进制数据的长度不小于第一预定长度, 则从所述十进制数据 的低位开始连续取第一预定长度的数据作为变换后的数据; 如果所述十进制数据的长度小于第一预定长度, 则将所述十进制数据的 高位补零至第一预定长度, 并将高位补零后的数据作为变换后的数据。 一种数据变换装置, 包括: 第一获取单元, 用于从待变换数据串的预定位置获取偏移量; 第二获取单元, 用于才艮据所述偏移量从待变换数据串中获取预定位数的 数据; 变换单元, 用于将所获取的数据变换为十进制数据; 判断单元, 用于判断所述十进制数据的长度是否小于第一预定长度; 输出单元, 用于在所述十进制数据的长度不小于第一预定长度时, 从所 述十进制数据的低位开始连续取第一预定长度的数据作为变换后的数据; 在 所述十进制数据的长度小于第一预定长度时, 将所述十进制数据的高位补零 至第一预定长度, 并将高位补零后的数据作为变换后的数据。 本发明提供的数据变换方法及装置, 从待变换数据串中取出连续的预定 个数的比特位; 然后通过所取出的比特位可以计算出偏移量, 并根据所述偏 移量从待变换数据串中获取预定位数的数据; 再对取出的字符进行变换得到 十进制数据, 并且最后只输出一个第一预定长度的数据作为变换后的数据。 本发明在变换后的十进制数据长度足够时, 可以只取其中第一预定长度的数 据; 当十进制数据长度不够时, 则将十进制数据补零到第一预定长度; 从而 实现了最后得到的结果长度是统一的。 由于在本发明实现过程中只需要执行取出比特位、 计算偏移量、 取出连 续字符、 格式变换、 输出预定长度的数据等简单操作, 省去了消息摘要等复 杂的计算过程, 使得该数据变换方法相对于现有技术的方案更为简单, 容易 实现; 而且该方案中需要的操作通用性较强, 使得该方案能够普遍运用到很 多需要数据变换的过程中。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以才艮据这些附图获得其他的附图。 图 1为本发明实施例中数据变换方法流程图; 图 2为本发明实施例中数据变换装置框图; 图 3为本发明实施例 1中数据变换方法的流程图; 图 4为本发明实施例 2中数据变换方法的流程图; 图 5为本发明实施例 3中数据变换装置的框图。 具体实施方式 本发明实施例提供一种数据变换方法, 如图 1所示, 该方法包括:
101、 在得到随机数等各种待变换数据串后, 从待变换数据串中的预定 位置取出连续预定个数的比特位作为偏移量, 例如: 取出待变换数据串中最 后一个字节的后四个比特位, 或取出待变换数据串中第一个字节的八个比特 位等; 本过程中的待变换数据串可以是: 用户直接输入的随机数据, 也可以是 经过无碰撞的单向算法变换后得来的数据;
102、 在获得偏移量后, 可以才艮据所述偏移量从待变换数据串中获取预 定位数的数据, 本发明实施例中的预定位数可以随着待变换数据串的长度不 同进行相应调整; 103、 将所获取的预定位数的数据变换为十进制数据, 具体变换方法可 以釆用现有的运算方法, 如二进制换成十进制的方法、 十六进制换成十进制 的方法;
104、 判断所述十进制数据的长度是否小于第一预定长度, 如果所述十 进制数据的长度不小于第一预定长度, 则执行 105过程; 如果所述十进制数 据的长度小于第一预定长度, 则执行 106过程;
105、 从所述十进制数据的氏位开始连续取第一预定长度的数据作为变 换后的数据;
106、 将所述十进制数据的高位补零至第一预定长度, 并将高位补零后 的数据作为变换后的数据。 本发明实施例还提供一种数据变换装置, 如图 2所示, 该装置包括: 第 一获取单元 21、 第二获取单元 22、 变换单元 23、 判断单元 24和输出单元 25。 在得到随机数等各种待变换数据串后, 所述第一获取单元 21 用于从待 变换数据串的预定位置获取偏移量, 待变换数据串可以是: 用户直接输入的 随机数据, 也可以是经过无碰撞的单向算法变换后的数据; 第二获取单元 22 用于才艮据所述偏移量从待变换数据串中获取预定位数的数据; 变换单元 23 用于将所获取的数据变换为十进制数据; 判断单元 24 用于判断所述十进制 数据的长度是否小于第一预定长度; 输出单元 25 用于在所述十进制数据的 长度不小于第一预定长度时, 从所述十进制数据的低位开始连续取第一预定 长度的数据作为变换后的数据; 在所述十进制数据的长度小于第一预定长度 时, 将所述十进制数据的高位补零至第一预定长度, 并将高位补零后的数据 作为变换后的数据。 本发明实施例提供的数据变换方法及装置, 从待变换数据串中取出连续 的预定个数的比特位; 然后通过所取出的比特位可以计算出偏移量, 并根据 所述偏移量从待变换数据串中获取预定位数的数据; 再对取出的字符进行变 换得到十进制数据, 并且最后只输出一个第一预定长度的数据作为变换后的 数据。 本发明实施例在变换后的十进制数据长度足够时, 可以只取其中第一 预定长度的数据; 当十进制数据长度不够时, 则将十进制数据补零到第一预 定长度; 从而实现了最后得到的结果长度是统一的。 由于在本发明实现过程中只需要执行取出比特位、 计算偏移量、 取出连 续字符、 格式变换、 输出预定长度的数据等简单操作, 省去了消息摘要等复 杂的计算过程, 使得该数据变换方法相对于现有技术的方案更为简单, 容易 实现; 而且该方案中需要的操作通用性较强, 使得该方案能够普遍运用到很 多需要数据变换的过程中。 为了进一步详细说明本发明实施例的应用情况, 下面将结合本发明实施 例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。 基于本 发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获得 的所有其他实施例, 都属于本发明保护的范围。 实施例 1: 如图 3 , 本发明实施例提供了一种数据转换的方法, 以十六进制的待变 换 数 据 串
" 0x3A4362FE8094C8AllD7F5BE38410E8F16758DA23FF3B3E85D7 " 变换 为 4位的十进制数为例进行说明, 即: 第一预定长度为 4, 本实施例中数据 转换的方法具体过程如下:
301、 在得到上述十六进制的待变换数据串后, 从待变换数据串中的预 定位置取出连续预定个数的比特位作为偏移量; 其中, 所述预定位置可以是待变换数据串中的第一个字节、 最后一个字 节、 或者中间任意一个字节。 一般情况下, 在待变换数据串的长度是已知的 的情况下, 所述预定位置还可以取待变换数据串中的中间任意一个位置, 例 如取待变换数据串的中间位置、 三分之一长度处, 或者某个具体的位置如第 二、 第三个字节, 等等。 优选的, 本实例中去取待变换数据串的首字节作为 偏移量, 即: 本实例中获取的偏移量为 "0x3A" ; 当然, 在某些情况下, 例如: 待变换数据串长度是已知的且长度比较短, 那么为了增加数据变换的随机性, 本发明实施例在 301之前还可以将较短的 待变换数据串进行预处理, 所述预处理为将待变换数据串经过无碰撞的单向 算法处理, 本实施例中的无碰撞的单向算法为哈希算法或消息-险证代码算法 ( HMAC ) , 例如: SHA- 1等哈希算法。 302、 为了保证能够从待变换数据串中取出预定位数的数据, 需要确保 所获取的偏移量不会越界, 故而本过程判断偏移量是否超过待变换数据串的 长度, 如果偏移量超过待变换数据串的长度, 表示偏移量越界, 则执行 303; 如果偏移量不超过待变换数据串的长度, 表示偏移量没有越界, 则执行 304; 本步骤中, 判断偏移量是否超过数据串的长度的具体方法可以是: 将获 取的偏移量转换为十进制数据,该十进制数据与待变换数据串长度比较大小, 如果该十进制数据大于待变换数据串长度, 则认为偏移量越界; 在本实施例中本实例中,获取的偏移量 "0x3A"对应的十进制数据为 58, 而待变换数据串长度为 25 , 上述十进制数据大于待变换数据串长度, 所以上 述偏移量越界, 需要执行 303; 303、 将偏移量变换为不超过数据串长度的值; 本实施例中的具体方法 为: 将十进制数据除以待变换数据串长度得到的余数作为偏移量; 设数据串 的长度是 N, 偏移量是 n, 对应具体的实现代码如下:
While(n>N) n=N-n; 该代码表达的意义为: 只要偏移量超过数据串长度, 就将偏移量减去数 据串长度直到偏移量不超过数据串长度; 本发明实施例 302中得到的十进制数据为 58, 按照本过程的计算方法, 最后得到的偏移量为 0x08; 本发明实施例中将偏移量进行相应的运算后作为新的偏移量, 在实际运 用时可以直接将从待变换数据串中取出的比特位作为偏移量, 并且所取比特 位可以为 8个比特位、 4个比特位或者其他个数的比特位;
304、 在获取了上述偏移量后, 从待变换数据串的偏移量对应的位置获 取预定位数的数据; 其中, 所述预定位数可以才艮据待变换数据串的长度来确 定, 在本实施例中以预定位数为 15比特位为例进行说明, 通过该 15比特位 来匹配 int型数的长度;从上述得到的偏移量为 0x08的情况可以得到预定位 数的数据具体为 "0xlD7F";
305、 将获取的预定位数的数据变换为十进制形式, 上述数据 "0xlD7F" 变换为十进制的结果为: 7551 ;
306、 判断所述十进制数据的长度是否小于第一预定长度, 如果所述十 进制数据的长度不小于第一预定长度, 则执行 307过程; 如果所述十进制数 据的长度小于第一预定长度, 则执行 308过程; 本实施例中第一预定长度为 4 ,等于 305中计算出的十进制数 7551的长 度, 所以本实施例中可以执行 307过程;
307、 从所述十进制数据的氏位开始连续取第一预定长度的数据作为变 换后的数据, 即: 并取其中的低四位作为变换后的数据; 有上面描述可知本 实施例中最后变换后的数据是: 7551 ; 设 X为获取的预定位数的数据, buff 是用于存放转换结果的緩冲区, 以下代码可完成转换: Sprint(buf , "%05d",X); 该代码中最后 Buff的氏四位就是最终的转换结果;
308、 将所述十进制数据的高位补零至第一预定长度, 并将高位补零后 的数据作为变换后的数据; 本过程就是在获取的预定位数的数据转换为十进 制后不足四位的话, 则高位补零, 使其补足四位; 在补足四位数据后将补零 后的数据作为变换后的数据。 本发明实施例提供的数据变换方法及装置, 从待变换数据串中取出连续 的预定个数的比特位; 然后通过所取出的比特位可以计算出偏移量, 并根据 所述偏移量从待变换数据串中获取预定位数的数据; 再对取出的字符进行变 换得到十进制数据, 并且最后只输出一个第一预定长度的数据作为变换后的 数据。 本发明实施例在变换后的十进制数据长度足够时, 可以只取其中第一 预定长度的数据; 当十进制数据长度不够时, 则将十进制数据补零到第一预 定长度; 从而实现了最后得到的结果长度是统一的。 由于在本发明实现过程中只需要执行取出比特位、 计算偏移量、 取出连 续字符、 格式变换、 输出预定长度的数据等简单操作, 省去了消息摘要等复 杂的计算过程, 使得该数据变换方法相对于现有技术的方案更为简单, 容易 实现; 而且该方案中需要的操作通用性较强, 使得该方案能够普遍运用到很 多需要数据变换的过程中。 实施例 2: 本实施例提供了一种数据变换方法, 在本实施例中将待变换数据串看作 指定字节的大数, 并按照 BIG-ENDIAN (低地址存放最高有效字节)形式进 行存储。 本实施例中需要将待变换数据串变换为 6位数字字符, 其中, 待变 换数据串的十六进制为:
"0x5 A83152391B06745E0901 AA4AF315CC32056516B" ,该待变换数据 串中包括 20字节。 如果需要将待变换数据串的长度固定为 20 字节, 但是原始提供的待变 换数据串不是 20 字节, 本发明实施例可以对其进行预处理, 如: 补位、 截 短等, 最后得到 20 字节的数据。 所述预处理为将待变换数据串经过无碰撞 的单向算法处理, 本实施例中的无碰撞的单向算法为哈希算法或消息-险证代 码算法 (HMAC ), 例如: SHA-1等哈希算法。 如图 4所示, 本发明实施例对应的数据变换方法包括如下过程:
401、 从待变换数据串中的预定位置取出连续预定个数的比特位作为偏 移量, 本实施例中为取待转换数据串的最低有效四位 (以二进制计算) 作为 偏移量, 具体为 "OxOB" ; 本实施例中釆用了较为简单的方式获取偏移量, 在实际运用时也可以釆 用实施例 1中提供的方式获取偏移量, 此处不再赞述;
402、 按照预定公式对所述偏移量进行计算得到算术右移位数, 其中预 定公式可以釆用但不限于如下公式: BITS=128-LBS4*8; 其中, BITS表示算 术右移位数, LSB4 表示偏移量。 在本实施例提供的预定公式下计算出的算 术右移位数为: 120-11*8=40; 这里的算术右移位数是指按照比特位向右移动 的位数;
403、 将所述待变换数据串按照所述算术右移位数进行算术右移, 得到 右移之后的待变换数据串, 本实施例中本实例中, 将待变换数据串右移 40 位后得到的数据串为: "0x00000000005 A83152391B06745E0901 AA4AF315C" ;
404、 从右移后的待变换数据串最低位开始获取预定位数的数据, 假如本 实施例中预定位数是指 31个比特位, 那么本实施例从上述右移之后的待变换数 据串中最低位依次取出的数据为: 0x24 AF315C; 本步骤的具体实现方法可以釆用但不限于如下方法: 设算术右移后的数据 串为 RESULT1 , 最低有效 31位数据是 RESULT2, 以下代码给出具体的获取方 法:
RESULT2= RESULT 1 &0x7FFFFFFF;
405、 将获取的预定位数的数据变换为十进制形式, 上述数据 "0x24AF315C " 变换为十进制的结果为: 615461212;
406、 判断所述十进制数据的长度是否小于第一预定长度, 如果所述十 进制数据的长度不小于第一预定长度, 则执行 407过程; 如果所述十进制数 据的长度小于第一预定长度, 则执行 408过程; 本实施例中第一预定长度为 6,小于 405中计算出的十进制数 615461212 的长度, 所以本实施例中可以执行 407过程;
407、 从所述十进制数据的氏位开始连续取第一预定长度的数据作为变 换后的数据, 即: 取其中的低 6位作为变换后的数据; 由上面描述可知本实 施例中最后变换后的数据是: 461212; 设 X为获取的预定位数的数据, buff 是用于存放转换结果的緩冲区, 以下代码可完成转换: Sprint(buf , "%05d",X); 该代码中最后 Buff的氏四位就是最终的转换结果;
408、 将所述十进制数据的高位补零至第一预定长度, 并将高位补零后的 数据作为变换后的数据; 本过程就是在获取的预定位数的数据转换为十进制后 不足六位的话, 则高位补零, 使其补足六位; 在补足六位数据后将补零后的数 据作为变换后的数据。 本实施例可以通过软件产品加硬件的方式实现, 通过硬件执行软件产品 的指令完成上述数据变换的方法, 本实施例提供的软件产品包括但不限于如 下实现方案:
〃取最后字节的后四位作为索引
〃计算该索引开始的连续四个字节的 31位值
〃将该值按照设定的数字位数生成数字串 idx = data[dig_len - 1] & OxOf;〃取数据值最后字节的后四位作为索引 〃防止计算的索引越界 if (idx + 3 >= dig_len) {
idx = dig len- 4;
}
〃计算该索引开始的连续四个字节的 3 1位值 otp = ((data[idx] & 0x7f) « 24) +
(data[idx + 1] « 16) +
(data[idx + 2] « 8) +
data[idx + 3] ;
if (digit >= (sizeof(digit_power) I sizeof(digit_power[0]))) {
digit = 0;
}
otp = otp % digit_power [digit] ; 〃将该值按照设定的数字位数生成
OTP 本发明实施例提供的数据变换方法及装置, 从待变换数据串中取出连续 的预定个数的比特位; 然后通过所取出的比特位可以计算出偏移量, 并根据 所述偏移量从待变换数据串中获取预定位数的数据; 再对取出的字符进行变 换得到十进制数据, 并且最后只输出一个第一预定长度的数据作为变换后的 数据。 本发明实施例在变换后的十进制数据长度足够时, 可以只取其中第一 预定长度的数据; 当十进制数据长度不够时, 则将十进制数据补零到第一预 定长度; 从而实现了最后得到的结果长度是统一的。 由于本实施例通过将待变换数据串右移、 并从右移后的数据的氐位取数 据, 能够简化获取预定位数数据的过程, 提高数据获取的效率和准确度。 又由于在本发明实现过程中只需要执行取出比特位、 计算偏移量、 取出 连续字符、 格式变换、 输出预定长度的数据等简单操作, 省去了消息摘要等 复杂的计算过程, 使得该数据变换方法相对于现有技术的方案更为简单, 容 易实现; 而且该方案中需要的操作通用性较强, 使得该方案能够普遍运用到 很多需要数据变换的过程中。 实施例 3: 本发明实施例还提供一种数据变换装置, 如图 5所示, 该装置包括: 第 一获取单元 51、 第二获取单元 52、 变换单元 53、 判断单元 54和输出单元 55。 在得到随机数等各种待变换数据串后, 所述第一获取单元 51 用于从待 变换数据串的预定位置获取偏移量, 待变换数据串可以是: 用户直接输入的 随机数据, 也可以是经过无碰撞的单向算法变换后的数据; 第二获取单元 52 用于才艮据所述偏移量从待变换数据串中获取预定位数的数据; 变换单元 53 用于将所获取的数据变换为十进制数据; 判断单元 54 用于判断所述十进制 数据的长度是否小于第一预定长度; 输出单元 55 用于在所述十进制数据的 长度不小于第一预定长度时, 从所述十进制数据的低位开始连续取第一预定 长度的数据作为变换后的数据; 在所述十进制数据的长度小于第一预定长度 时, 将所述十进制数据的高位补零至第一预定长度, 并将高位补零后的数据 作为变换后的数据。 一般来讲上述第一获取单元 51 在获取偏移量时, 可以从待变换数据串 的第一个字节、 中间任意一字节、 或最后一个字节中获取; 具体而言, 所述 第一获取单元 51包括: 第一获取模块 511、 判断模块 512、 输出模块 513。 第一获取模块 511用于从待变换数据串的预定位置对应字节中取出 4个 比特位或 8个比特位; 判断模块 512用于判断所取出比特位对应的十进制数 是否超过待变换数据串长度; 输出模块 513用于在所取出比特位对应的十进 制数不超过待变换数据串长度时, 将所取出比特位对应的十进制数作为偏移 量; 在所取出比特位对应的十进制数超过待变换数据串长度时, 将所取出比 特位对应的十进制数除以待变换数据串长度得到的余数作为偏移量, 或者将 所取出比特位对应的十进制数减去待变换数据串长度的整数倍作为偏移量。 当然, 如果所述第一获取单元 51 直接从待变换数据串的预定位置对应 字节中取出 4个比特位, 由于 4个比特位对应十进制数最大为 15 , 在待变换 数据串长度够长的情况下, 可以将所取出比特位对应的十进制数直接作为偏 移量, 也不会导致偏移量越界。 本发明实施例中第二获取单元 52 的具体实现方式包括但不限于如下方 案: 第一、 所述第二获取单元 52 用于从待变换数据串中与所述偏移量对应 的位置处获取预定位数的数据。 第二、 所述第二获取单元 52包括: 计算模块 521、 右移模块 522、 第二 获取模块 223。 其中, 计算模块 521用于按照预定公式对所述偏移量进行计算得到算术 右移位数, 预定公式可以釆用但不限于实施例 2 中提供的公式: BITS=128-LBS4*8; 其中, BITS表示算术右移位数, LBS4表示偏移量; 右 移模块 522用于将所述待变换数据串按照所述算术右移位数进行算术右移; 第二获取模块 523用于从右移后的待变换数据串最低位开始获取预定位数的 数据。 本发明实施例主要用在各种需要进行数据变换的设备和方法中, 例如: 动态口令的生成过程和设备。 通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解到本 发明可借助软件加必需的通用硬件的方式来实现, 当然也可以通过硬件, 但 很多情况下前者是更佳的实施方式。 基于这样的理解, 本发明的技术方案本 计算机软件产品存储在可读取的存储介质中, 如计算机的软盘, 硬盘或光盘 等, 包括若千指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等) 执行本发明各个实施例所述的方法。 以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到的变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保 护范围应所述以权利要求的保护范围为准。

Claims

权 利 要 求 书
1. 一种数据变换方法, 其特征在于, 包括:
从待变换数据串的预定位置获取偏移量;
才艮据所述偏移量从待变换数据串中获取预定位数的数据; 将所获取的数据变换为十进制数据;
判断所述十进制数据的长度是否小于第一预定长度; 如果所述十进制数据的长度不小于第一预定长度, 则从所述十进 制数据的低位开始连续取第一预定长度的数据作为变换后的数据; 如果所述十进制数据的长度小于第一预定长度, 则将所述十进制 数据的高位补零至第一预定长度, 并将高位补零后的数据作为变换后 的数据。
2. 根据权利要求 1所述的数据变换方法, 其特征在于, 所述预定位置包 括所述待变换数据串的第一个字节、 中间任意一个字节、 或最后一个 字节; 所述从待变换数据串的预定位置获取偏移量包括:
从待变换数据串的预定位置对应字节中取出 4个比特位或 8个比 特位;
判断所取出比特位对应的十进制数是否超过待变换数据串长度; 如果所取出比特位对应的十进制数不超过待变换数据串长度, 则 将所取出比特位对应的十进制数作为偏移量;
如果所取出比特位对应的十进制数超过待变换数据串长度, 则将 所取出的比特位对应的十进制数除以待变换数据串长度得到的余数作 为偏移量, 或者将所取出的比特位对应的十进制数减去待变换数据串 长度的整数倍作为偏移量。
3. 根据权利要求 1所述的数据变换方法, 其特征在于, 所述预定位置包 括所述待变换数据串的第一个字节、 中间任意一个字节、 或最后一个 字节; 所述从待变换数据串的预定位置获取偏移量为: 从待变换数据 串的预定位置对应字节中取出 4个比特位, 并将所取出比特位对应的 十进制数作为偏移量。 根据权利要求 1、 2或 3所述的数据变换方法, 其特征在于, 所述根据 所述偏移量从待变换数据串中获取预定位数的数据包括:
按照预定公式对所述偏移量进行计算得到算术右移位数; 将所述待变换数据串按照所述算术右移位数进行算术右移; 从右移后的待变换数据串最氏位开始获取预定位数的数据。 根据权利要求 4所述的数据变换方法, 其特征在于, 所述预定公式为: BITS=128-LBS4*8; 其中, BITS表示算术右移位数, LBS4表示偏移 量。 根据权利要求 1、 2或 3所述的数据变换方法, 其特征在于, 所述根据 所述偏移量从待变换数据串中获取预定位数的数据为: 从待变换数据 串中与所述偏移量对应的位置处获取预定位数的数据。 才艮据权利要求 1所述的数据变换方法, 其特征在于, 所述待变换数据 串为经过无碰撞的单向算法处理后的待变换数据串。 根据权利要求 7所述的数据变换方法, 其特征在于, 所述无碰撞的单 向算法为哈希算法或消息验证代码算法。 一种数据变换装置, 其特征在于, 包括:
第一获取单元, 用于从待变换数据串的预定位置获取偏移量; 第二获取单元, 用于根据所述偏移量从待变换数据串中获取预定 位数的数据;
变换单元, 用于将所获取的数据变换为十进制数据;
判断单元, 用于判断所述十进制数据的长度是否小于第一预定长 度;
输出单元,用于在所述十进制数据的长度不小于第一预定长度时, 从所述十进制数据的低位开始连续取第一预定长度的数据作为变换后 的数据; 在所述十进制数据的长度小于第一预定长度时, 将所述十进 制数据的高位补零至第一预定长度, 并将高位补零后的数据作为变换 后的数据。
10. 根据权利要求 9所述的数据变换装置, 其特征在于, 所述预定位置包 括所述待变换数据串的第一个字节、 中间任意一个字节、 或最后一个 字节; 所述第一获取单元包括:
第一获取模块, 用于从待变换数据串的预定位置对应字节中取出 4个比特位或 8个比特位;
判断模块, 用于判断所取出比特位对应的十进制数是否超过待变 换数据串长度;
输出模块, 用于在所取出比特位对应的十进制数不超过待变换数 据串长度时, 将所取出比特位对应的十进制数作为偏移量; 在所取出 比特位对应的十进制数超过待变换数据串长度时, 将所取出比特位对 应的十进制数除以待变换数据串长度得到的余数作为偏移量, 或者将 所取出比特位对应的十进制数减去待变换数据串长度的整数倍作为偏 移量。
11. 根据权利要求 9所述的数据变换装置, 其特征在于, 所述预定位置包 括所述待变换数据串的第一个字节、 中间任意一个字节、 或最后一个 字节; 所述第一获取单元用于从待变换数据串的预定位置对应字节中 取出 4个比特位, 并将所取出比特位对应的十进制数作为偏移量。
12. 根据权利要求 9、 10或 11所述的数据变换装置, 其特征在于, 所述第 二获取单元包括:
计算模块, 用于按照预定公式对所述偏移量进行计算得到算术右 移位数;
右移模块, 用于将所述待变换数据串按照所述算术右移位数进行 算术右移;
第二获取模块, 用于从右移后的待变换数据串最低位开始获取预 定位数的数据。
13. 根据权利要求 12所述的数据变换装置 ,其特征在于,所述预定公式为: BITS=128-LBS4*8; 其中, BITS表示算术右移位数, LBS4表示偏移 量。
14. 根据权利要求 9、 10或 11所述的数据变换装置, 其特征在于, 所述第 二获取单元用于从待变换数据串中与所述偏移量对应的位置处获取预 定位数的数据。
PCT/CN2010/074598 2009-10-27 2010-06-28 数据变换方法及装置 WO2011050624A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US12/811,468 US8655932B2 (en) 2009-10-27 2010-06-28 Data converting method and a device therefor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910236912.8 2009-10-27
CN200910236912.8A CN101697116B (zh) 2009-10-27 2009-10-27 数据变换方法及装置

Publications (1)

Publication Number Publication Date
WO2011050624A1 true WO2011050624A1 (zh) 2011-05-05

Family

ID=42142222

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/074598 WO2011050624A1 (zh) 2009-10-27 2010-06-28 数据变换方法及装置

Country Status (3)

Country Link
US (1) US8655932B2 (zh)
CN (1) CN101697116B (zh)
WO (1) WO2011050624A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697116B (zh) * 2009-10-27 2011-11-09 飞天诚信科技股份有限公司 数据变换方法及装置
CN101950301A (zh) * 2010-09-26 2011-01-19 北京飞天诚信科技有限公司 数据处理的方法及装置
CN102411489B (zh) * 2011-10-18 2014-06-04 飞天诚信科技股份有限公司 一种嵌入式系统中的数据处理方法及装置
CN102594797B (zh) * 2011-12-30 2014-07-30 飞天诚信科技股份有限公司 一种在嵌入式系统中生成验证码的方法与装置
CN105721882B (zh) * 2016-04-18 2021-01-05 上海泥娃通信科技有限公司 一种分离编解码的方法
CN107154067B (zh) * 2017-03-31 2021-02-05 北京奇艺世纪科技有限公司 一种头像生成方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1215862A (zh) * 1997-07-09 1999-05-05 松下电器产业株式会社 计算方法和计算装置
CN101227286A (zh) * 2008-01-31 2008-07-23 北京飞天诚信科技有限公司 一种生成消息认证码的方法
CN101247233A (zh) * 2008-03-24 2008-08-20 北京飞天诚信科技有限公司 一种生成消息摘要的方法
CN101697116A (zh) * 2009-10-27 2010-04-21 北京飞天诚信科技有限公司 数据变换方法及装置

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4610027A (en) * 1983-12-30 1986-09-02 International Business Machines Corporation Method for converting a bit map of an image to a run length or run end representation
US4658430A (en) * 1984-12-27 1987-04-14 International Business Machines Corp. System for rotating binary images
JPH0682370B2 (ja) * 1987-05-26 1994-10-19 シャープ株式会社 文字処理装置
US5126739A (en) * 1989-01-13 1992-06-30 Stac Electronics Data compression apparatus and method
CA2045705A1 (en) * 1990-06-29 1991-12-30 Richard Lee Sites In-register data manipulation in reduced instruction set processor
GB2359967B (en) * 2000-02-29 2004-05-12 Virata Ltd Qamd
JP2002328803A (ja) * 2001-04-27 2002-11-15 Canon Inc データ変換装置及びデータ変換方法
JP2005018310A (ja) * 2003-06-25 2005-01-20 Nippon Telegr & Teleph Corp <Ntt> データ変換方法および装置
CN101044535B (zh) * 2005-03-16 2011-06-15 三菱电机株式会社 数据变换装置以及数据变换方法
WO2008078366A1 (ja) 2006-12-22 2008-07-03 Fujitsu Limited データ検証装置、データ検証方法およびデータ検証プログラム
CN100561546C (zh) * 2008-01-28 2009-11-18 和舰科技(苏州)有限公司 循环扩散偏移转码加密方法
US8392489B2 (en) * 2008-02-15 2013-03-05 International Business Machines Corporation ASCII to binary floating point conversion of decimal real numbers on a vector processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1215862A (zh) * 1997-07-09 1999-05-05 松下电器产业株式会社 计算方法和计算装置
CN101227286A (zh) * 2008-01-31 2008-07-23 北京飞天诚信科技有限公司 一种生成消息认证码的方法
CN101247233A (zh) * 2008-03-24 2008-08-20 北京飞天诚信科技有限公司 一种生成消息摘要的方法
CN101697116A (zh) * 2009-10-27 2010-04-21 北京飞天诚信科技有限公司 数据变换方法及装置

Also Published As

Publication number Publication date
US20120089653A1 (en) 2012-04-12
US8655932B2 (en) 2014-02-18
CN101697116B (zh) 2011-11-09
CN101697116A (zh) 2010-04-21

Similar Documents

Publication Publication Date Title
Eastlake 3rd et al. US secure hash algorithms (SHA and SHA-based HMAC and HKDF)
WO2011050624A1 (zh) 数据变换方法及装置
CN111683046B (zh) 文件压缩以及获取的方法、装置、设备及存储介质
US7190791B2 (en) Method of encryption using multi-key process to create a variable-length key
WO2019114122A1 (zh) 登录信息的加密方法、装置、电子设备及介质
US10225087B2 (en) Methods and systems for randomized message generation for cryptographic hash functions
JP6120961B2 (ja) 特定フォーマットを有する代替データの生成および検証
JP5636489B2 (ja) 2進乱数列を整数乱数に変換する装置および方法
US20130322620A1 (en) Apparatus and method for generating secret key for id-based encryption system and recording medium having program recorded thereon for causing computer to execute the method
CN110543778A (zh) 一种字符数据线性随机加密和解密算法
CN110995415A (zh) 一种基于md5算法的加密算法
CN102542070B (zh) 基于随机函数的单向哈希函数构造方法
CN112800482A (zh) 基于身份的在线/离线安全云存储审计方法
JP5427117B2 (ja) メッセージ認証子生成装置、メッセージ認証子検証装置、メッセージ認証子生成方法、メッセージ認証子検証方法、およびプログラム
CN107947944B (zh) 一种基于格的增量签名方法
CN114422209B (zh) 一种数据处理的方法、装置及存储介质
Abutaha et al. New one way hash algorithm using non-invertible matrix
CN109905241B (zh) 一种椭圆曲线公钥的短汉字编码、解码方法
CN109687954B (zh) 用于算法加速的方法和装置
JP4986162B2 (ja) 電子署名システム
CN114244552B (zh) 基于区块链的数据加密传输方法及装置
CN101814989B (zh) 用于散列到椭圆曲线的点上的方法和设备
JP5006770B2 (ja) メッセージ認証子生成装置、メッセージ認証子検証装置、メッセージ認証子生成方法、メッセージ認証子検証方法、プログラム、および記録媒体
CN116243887A (zh) 软件随机数生成方法及装置
JP3240723B2 (ja) 通信方法、秘密通信方法及び署名通信方法

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 12811468

Country of ref document: US

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

Ref document number: 10825987

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10825987

Country of ref document: EP

Kind code of ref document: A1