Payment encryption algorithm
Technical Field
The invention relates to an algorithm, in particular to an algorithm for payment encryption, and belongs to the technical field of IPC classification G06 and G09.
Background
The payment system is composed of an intermediary institution providing payment clearing service and professional technical means for realizing payment instruction transmission and fund clearing, and is a financial arrangement for realizing debt and debt payment and fund transfer, which is sometimes called as clearing system.
At present, when payment is carried out, a payment carrier of a payment system comprises a magnetic stripe card and a mobile device (including bar code scanning, two-dimensional code scanning and NFC near field payment). Magnetic stripe cards have the potential to be copied and are therefore now upgraded to chip cards. When the code is scanned, the two-dimensional code is possibly stolen, so that the code scanning tends to provide a dynamically-changed bar code by a mobile device or the two-dimensional code is scanned safely. And the near-field payment is more troublesome to use than code scanning, and the popularization range is limited.
In addition, the bank card needs to be carried by swiping the card, the code scanning and near-field payment all need to provide and carry mobile equipment, and the mobile equipment is more convenient to carry for the young people who advocate light travel at present, but the mobile equipment is limited by a battery and a network, so that at present, no more convenient payment carrier exists, the system or the method can be operated independently by separating from the network, and the system or the method has safety to achieve real convenience.
Disclosure of Invention
The present invention is directed to solving the above-mentioned problems, and provides an algorithm for payment encryption, which can be operated independently from the network, and also has security and convenience in selection of attached carriers.
The technical scheme for solving the problems of the invention is as follows:
an algorithm for payment encryption, comprising:
the system comprises a payment end, a verification end and a verification server end, wherein a user uploads image files with the same attribute to the payment end and the verification server end regularly or irregularly as a key carrier;
inserting the hash value of the image file into an encryption program of a payment terminal and a verification server terminal, taking the hash value as a section of code when the encryption program runs, randomly generating a dynamic number through the whole section of code according to a time seed, converting the dynamic number into a planar two-dimensional pixel point through a conversion program, generating a key pixel point within a range based on the range of the pixel size of a key carrier file, and overlapping the key pixel point on a key carrier;
when the user pays, the verification server reads the key carrier displaying the superposed key pixel points through the verification end, and obtains the result of whether to pass the payment or not by comparing the pixel positions of the key pixel points.
When the dynamic number is converted into the planar two-dimensional pixel point through the conversion program, the conversion program reads partial numerical value of the hash value of the image file according to the time seed to be used as a section of code of the conversion program.
When the conversion program converts the dynamic digit into a planar two-dimensional pixel point, the range of the pixel size of the key carrier file is a partial area with light color or blank pixel points of the image file.
When the conversion program converts the dynamic number into the planar two-dimensional pixel point, the generated planar two-dimensional pixel point is different from the region color of the pixel point of the key carrier in designation.
The invention has the following beneficial effects:
the key carrier can be self-defined, and has stronger flexibility; the payment end does not need to be networked or upload and download any information during verification, the verification server obtains key pixel points from the content obtained by the payment end through the verification end, and payment release is realized after verification, so that the payment system has extremely high safety; the payment terminal can be made very small in size, long in standby time and excellent in convenience.
Description of the drawings:
FIG. 1 is a schematic diagram of the frame construction of the present invention;
FIG. 2 is a schematic diagram of a process from an image file to a key pixel according to the present invention.
The specific implementation mode is as follows:
the invention is explained in further detail below with reference to the drawings.
Referring to fig. 1 and 2, a payment encryption algorithm includes a payment terminal 1, a verification terminal 2 and a verification server terminal 3, wherein a user 4 uploads an image file 5 with the same attribute to the payment terminal and the verification server terminal regularly or irregularly as a key carrier 6;
the hash value of the image file 5 is inserted into the encryption programs of the payment terminal 1 and the verification server terminal 3 and is used as a section of code when the encryption program runs, a dynamic number 8 is randomly generated through the whole section of code according to a time seed, the dynamic number 8 is converted into a plane two-dimensional pixel point through a conversion program, and a key pixel point 7 is generated in a range and is superposed on a key carrier based on the range of the pixel size of the key carrier file;
when the user 4 pays, the verification server 3 reads the key carrier of the payment terminal 1 displaying the superposed key pixel point 7 through the verification terminal 2, and obtains the result of whether to pass the payment or not by comparing the pixel positions of the key pixel points.
When the invention is used, the time seed is in the unit of the day, so that the dynamic number 8 generated by the payment terminal 1 and the verification service terminal 3 can keep consistency. That is, the period of the dynamic change of the key pixel point is 1 day. For security reasons, there may be limits for each payment and a limit for the total amount paid per day, which minimizes losses even if the payment terminal 1 is lost or stolen.
When the hash value is inserted into the encryption programs of the payment terminal 1 and the verification server terminal 3 again, a part of digital strings of the hash value can be selected and extracted, and the selection of the part of digital strings can select the digit of the hash value according to the time unit uploaded by the image file 5 and the time seed. Therefore, the time of uploading the image file 5 to the payment terminal 1 and the authentication server 3 needs to be kept in the same time unit.
Based on the improvement of the implementation mode, when the dynamic number 8 is converted into the planar two-dimensional pixel point through the conversion program, the conversion program reads a part of numerical values of the hash value of the image file according to the time seed to be used as a section of codes of the conversion program.
Further, based on the improvement of the embodiment, when the conversion program converts the dynamic number 8 into the planar two-dimensional pixel point, the range of the pixel size of the key carrier file is a partial area where the pixel point of the image file is lighter in color or blank.
Therefore, the situation that one or more points of the converted planar two-dimensional pixel points are superposed on the pixel points with darker colors of the image file 5 can be eliminated, and the problem of identification can be caused.
In addition, based on the improvement of the embodiment, when the conversion program converts the dynamic number into the planar two-dimensional pixel point, the generated planar two-dimensional pixel point is specified to be different from the area color of the pixel point of the key carrier.