A kind of transmission/method of reseptance of secret communication
Technical field
The invention belongs to command, control, communications, and information safe practice field, relate to a kind of method for communicating, more specifically relate to a kind of transmission/method of reseptance of secret communication.
Background technology
Secret communication is an importance of command, control, communications, and information safe practice, and Information Hiding Techniques is to realize a kind of important method of secret communication, promptly the important information that will transmit is hidden in the carrier, makes it be difficult for being discovered.The carrier of Information Hiding Techniques can have a lot, as header of text, image, audio frequency, video and TCP/IP etc.Discovery by retrieval, existing information concealing method based on ICP/IP protocol mainly rely on following territory to realize hiding: the common seldom territory of usefulness when the option field of (1) TCP or IP head and transmission data; The territory that must force to fill when (2) transmitting data hides Info, as the source port territory in the source address field in the IP data packet head, destination address domain, mark domain and the tcp data packet header, destination interface territory, sequence number territory etc.Rely on the Information Hiding Techniques in these territories, owing to Hidden field is known by everybody, so crypticity is not high; At these technology, attack methods such as packet filtering, chi square analysis have appearred, and utilize these attack methods can detect or extract TCP or the hiding information of IP head, therefore be easy to be attacked, fail safe is not high.
Summary of the invention
Technical problem to be solved by this invention is: introduce at above that existing Information Hiding Techniques based on ICP/IP protocol is existing is easily attacked and the not high defective of fail safe, propose a kind of transmission/method of reseptance of in computer network environment, realizing secret communication, make secret information have better crypticity and anti-aggressive.
To achieve these goals, the technical scheme that the present invention addresses the above problem is a kind of transmission/method of reseptance of secret communication, first the Information hiding that will transmit is in carrier in network environment, when transmit leg sends network data, verification territory at the network protocol data unit header embeds information at random, and embedding information is passed through to revise the data field verification; After the recipient receives network protocol data unit from network, from the information extraction of verification territory.
Wherein, described sending method comprises the steps:
Step 1: with sharing the secret information that secret key encryption will send, the cryptographic algorithm of use is RC4;
Step 2: the information after encrypting is represented with binary bit stream, be divided into one group of 8 bit; If encrypting the length of back information is l, then total m=l/8 group; If the length of encrypting back information is not 8 integral multiple, then in the end " 0 " is filled in one group back; The original order ordering of all groupings by information;
Step 3: construct m transport layer protocol data cell, fill each field and the data field of each protocol Data Unit stem, and generate verification and, insert in the verification territory;
Step 4: the m that obtains in the step 2 group bit stream is embedded into respectively in the verification territory of m the transport layer protocol data cell that obtains in the step 3, and 8 bits of every group are embedded in the protocol Data Unit, and are embedded on the random site that both sides appoint;
Step 5: to each protocol Data Unit that obtains in the step 4, the data field according in its check digit correction data cell that has changed makes verification and still correct;
Step 6:, send to the recipient successively according to the agreement of transport layer and the sequencing of each grouping all m protocol Data Unit that obtains in the step 5.
Above-mentioned transport layer protocol data cell refers to TCP message segment or UDP datagram, and its message format is seen accompanying drawing 5, pseudo-head wherein only be for calculation check and, calculation check and the time pseudo-head and TCP section or the calculating together of UDP newspaper.
The generative process in the verification territory of above-mentioned transport layer protocol data cell, according to TCP and udp checksum and computational methods, promptly head, data and the pseudo-head of TCP section or UDP newspaper calculation check together and.During calculating, earlier the part of wanting verification is divided into the sequence of many 16 words, and verification and zero setting, with the radix-minus-one complement arithmetical operation all 16 word additions after, with obtain and radix-minus-one complement as the verification that generates with.Verification and generative process see accompanying drawing 6.Verification and checking procedure see accompanying drawing 7.
Above-mentioned random site refers to select 8 random bit positions and is used for hiding secret information in 16 bit positions in verification territory.8 random sites arrange to form by both party.8 random sites of each protocol Data Unit should have nothing in common with each other, and set in advance by both party.
The mode of bit replacement is adopted in above-mentioned embedding, promptly replaces the bit of 8 random sites in each transport layer protocol data cell verification territory with every group that obtains in the step 28 bits.
Above-mentioned similar process according to verification in data field in the check digit correction data cell that has changed and the transport layer protocol, promptly the radix-minus-one complement arithmetical operation is reinstated in the verification and of wanting the part (comprising pseudo-head, head and data field) of verification and having embedded secret information, press 16 word additions.If do not embed information in the verification territory, the result that addition obtains should be 1, expression verification and correct.Because make verification and variation has taken place after embedding 8 bit secret informations, still be 1 so need modification protocol Data Unit data field to make the result of addition, to guarantee verification and still correct.Its makeover process is seen accompanying drawing 8.
Above-mentioned sends successively according to the agreement of transport layer and the sequencing of each grouping, and transport layer protocol can be a Transmission Control Protocol, because the Transmission Control Protocol head has sequence number field (seeing accompanying drawing 5), so directly send all message segments by the sequence number field.
Above-mentioned sends successively according to the agreement of transport layer and the sequencing of each grouping, transport layer protocol can be a udp protocol, because the udp protocol head does not have sequence number field, so both sides appoint 16 bits choosing the UDP message territory in advance as the sequence number of representing each UDP datagram, the position of these 16 bits is appointed by both party in advance.
Described method of reseptance comprises the steps:
Step 1: receive all m transport layer protocol data cells according to transport layer protocol, and from small to large all protocol Data Units are sorted according to sequence number;
Step 2: to m the transport layer protocol data cell that obtains in the step 1,8 random sites according in each protocol Data Unit verification territory of both sides' agreement extract the bit value of these 8 positions, form one group of bit stream;
Step 3:, form complete information according to the order in the step 1 with all m group bit streams that obtain in the step 2;
Step 4: with sharing the information that obtains in key and the RC4 cryptographic algorithm decryption step 3, the secret information that acquisition will receive.
Above-mentioned transport layer protocol data cell refers to TCP message segment or UDP datagram, and its heading form is seen accompanying drawing 5, the pseudo-head of UDP datagram only be for calculation check and, calculation check and the time pseudo-head and UDP user datagram calculated together.
Above-mentioned transport layer protocol can be a Transmission Control Protocol, when transmit leg uses Transmission Control Protocol, because the Transmission Control Protocol head has sequence number field (seeing accompanying drawing 5), so the recipient directly sorts to all message segments by the value of sequence number field.
Above-mentioned transport layer protocol can be a udp protocol, because the udp protocol head does not have sequence number field, so both sides appoint that in advance 16 bits choosing the UDP message territory are as the sequence number of representing each UDP datagram, the position of these 16 bits appoints by both party in advance, according to the value of these 16 bits to all datagrams orderings.
Above-mentioned random site refers to select 8 bit positions at random in 16 bit positions in verification territory.8 random sites arrange to form by both party.8 random sites of each protocol Data Unit should have nothing in common with each other, and set in advance by both party.
Transmission/the method for reseptance of a kind of secret communication of the present invention, the characteristics and the beneficial effect that have are:
1, the Hidden field that relies among the present invention is the verification territory of protocol Data Unit header, and this field is not also used by other Information Hiding Techniques, therefore has better disguise;
2, rely on the verification territory to hide among the present invention, make verification and still correct by revising data field conversely again, this is a kind of method of reverse application verification territory completely newly, has good concealment effect;
3, the secret information among the present invention was encrypted with the RC4 cryptographic algorithm earlier before being hidden, and made it have better secret, even the assailant finds the latent existence of writing, also was difficult to decryption information;
4, among the present invention information to be embedded is divided into 8 bits and embeds for one group, only use 8 in 16 bits in verification territory during embedding, make that the statistical nature change in verification territory is less, can resist attack method based on statistical analysis;
5, the present invention adopts the method that embeds at random when the information of embedding, promptly be embedded in 8 random sites in each protocol Data Unit 16 bit check territory, and the random site of each protocol Data Unit is all inequality, makes the assailant be difficult to the discovery rule and attacks, and has good fail safe.
Description of drawings
Fig. 1 among the present invention based on the secret information transmission flow figure of Transmission Control Protocol;
Fig. 2 receives flow chart for the secret information based on Transmission Control Protocol among the present invention;
Fig. 3 among the present invention based on the secret information transmission flow figure of udp protocol;
Fig. 4 receives flow chart for the secret information based on udp protocol among the present invention;
Fig. 5 (a) is a TCP message paragraph header form in the Transmission Control Protocol, is UDP message header form in the udp protocol (b), (c) is pseudo-header format;
Fig. 6 be in Transmission Control Protocol and the udp protocol verification and product process figure;
Fig. 7 is the checking process figure in Transmission Control Protocol and the udp protocol;
Fig. 8 among the present invention according to the verification that has changed with revise data field, make verification and still correct flow chart.
Embodiment
Below in conjunction with accompanying drawing content of the present invention is further detailed.
1, use the data cell of Transmission Control Protocol to be as the method step of hiding carrier (referring to accompanying drawing 1 and accompanying drawing 2):
(1) secret encryption message.Key is shared by transmit leg and recipient, and cryptographic algorithm uses RC4, and the information after the encryption is divided into one group of 8 bit, altogether the m group.
(2) m TCP message segment of structure.Header fields such as the source port of each TCP section, destination interface and sequence number and data field are all inserted corresponding right value, and generate 16 bit checks and.Verification and generative process be the head of TCP section, data and pseudo-head calculation check together and, during calculating, earlier the part of wanting verification is divided into the sequence of many 16 words, and verification and zero setting, with the radix-minus-one complement arithmetical operation all 16 word additions after, with obtain and radix-minus-one complement as the verification that generates and.TCP paragraph header portion form is referring to accompanying drawing 5, verification and generative process referring to accompanying drawing 6.
(3) 8 random bit positions in 16 bit positions appointing in advance according to both sides, each TCP paragraph header portion 16 bit check that obtains from step (2) and extract 8.
(4) with every group 8 Bit data that extracts in the information after the encryption of every group 8 bit obtaining in the step (1) replacement step (3) successively.
(5) again according to random bit position same in the step (3), every group 8 Bit data that step (4) is obtained is put back in the verification territory.
(6) according to the verification territory that has changed in the step (5), revise the data field of message segment, correct to guarantee checksum validation.The Transmission Control Protocol verification and proof procedure be wanting the part (comprising pseudo-head, head and data field) and the verification and of verification to reinstate the radix-minus-one complement arithmetical operation, by 16 word additions, if the result that addition obtains is 1, expression verification and correct, otherwise then verification is incorrect, verification and proof procedure referring to accompanying drawing 7.Verification with makeover process similar to proof procedure, promptly the radix-minus-one complement arithmetical operation is reinstated in the verification and of wanting the part (comprising pseudo-head, head and data field) of verification and having embedded secret information, by 16 word additions, it still is 1 that the data field of modification TCP section makes the result of addition, guaranteeing that verification is correct, verification and makeover process referring to accompanying drawing 8.
(7) transmit leg sends to the recipient sequentially with all TCP message segments.
(8) recipient receives all m TCP message segments.
(9) extract each TCP message segment head 16 bit checks and.
(10) according to 8 random sites in 16 bit positions of prior agreement, each 16 bit check that obtains from step (9) and extract 8.
(11) all bits that step (10) is extracted are formed information according to the order of sequence.
(12),, thereby obtain the secret information that will receive according to RC4 cryptographic algorithm decryption information with sharing key.
2, use the data cell of udp protocol to be as the method step of hiding carrier (referring to accompanying drawing 3 and accompanying drawing 4):
(1) secret encryption message.Key is shared by transmit leg and recipient, and cryptographic algorithm uses RC4, and the information after the encryption is divided into one group of 8 bit, altogether the m group.
(2) structure UDP datagram.In each UDP datagram, header fields such as source port, destination interface and length and data field are all inserted corresponding right value.Choose 16 bits of data field in the UDP newspaper, 16 bit positions are appointed by both party in advance.The sequence number of each UDP newspaper is inserted respectively in these 16 bits, made reception can confirm the order of all UDP datagrams.Generate verification and process be head, data and the pseudo-head of UDP newspaper calculation check together and, during calculating, earlier the part of wanting verification is divided into the sequence of many 16 words, and verification and zero setting, with the radix-minus-one complement arithmetical operation all 16 word additions after, with obtain and radix-minus-one complement as the verification that generates and.The UDP datagram header format is referring to accompanying drawing 5, verification and generative process referring to accompanying drawing 6.
(3) 8 random bit positions in 16 bit positions appointing in advance according to both sides, from each UDP header portion 16 bit check and extract 8.
(4) with every group 8 Bit data that extracts in the information after the encryption of every group 8 bit obtaining in the step (1) replacement step (3) successively.
(5) again according to random bit position same in the step (3), every group 8 Bit data that step (4) is obtained is put back in the verification territory.
(6) according to the verification territory that has changed in the step (5), revise the data field of datagram, correct to guarantee checksum validation.Udp checksum and proof procedure be wanting the part (comprising pseudo-head, head and data field) and the verification and of verification to reinstate the radix-minus-one complement arithmetical operation, by 16 word additions, if the result that addition obtains is 1, expression verification and correct, otherwise then verification is incorrect, verification and proof procedure referring to accompanying drawing 7.Verification with makeover process similar to proof procedure, promptly the radix-minus-one complement arithmetical operation is reinstated in the verification and of wanting the part (comprising pseudo-head, head and data field) of verification and having embedded secret information, by 16 word additions, it still is 1 that the data field of modification UDP newspaper makes the result of addition, guaranteeing that verification is correct, verification and makeover process referring to accompanying drawing 8.
(7) transmit leg sends to the recipient with all UDP datagrams.
(8) recipient receives all UDP newspapers.And 16 bit positions of arranging in the data field according to each datagram, extract the sequence number of each datagram, datagram is sorted.
(9) extract each UDP datagram head 16 bit checks and
(10) according to 8 random sites in 16 bit positions of prior agreement, each 16 bit check that obtains from step (9) and extract 8.
(11) all bits that step (10) is extracted are formed information according to the order of sequence.
(12),, thereby obtain the secret information that will receive according to RC4 cryptographic algorithm decryption information with sharing key.