Summary of the invention
The invention provides a kind of method writing audio file copyright information, the method can prevent the copyright information writing audio file from being cracked easily and wiping.
The invention provides a kind of method reading audio file copyright information, the method can prevent the copyright information writing audio file from being cracked easily and wiping.
The invention provides a kind of device writing audio file copyright information, this device can prevent the copyright information writing audio file from being cracked easily and wiping.
Present invention also offers a kind of device reading audio file copyright information, this device can prevent the copyright information writing audio file from being cracked easily and wiping.
Write a method for audio file copyright information, the method comprises:
Original copyright information is encrypted, obtains copyright ciphertext;
For copyright ciphertext adds copyright indexing head, build virtual audio Frame by the copyright ciphertext adding copyright indexing head, virtual audio Frame empty part quiet data is filled;
Judge whether the quiet region searched out in audio file, if so, then the virtual audio Frame of structure is inserted quiet region; Otherwise the virtual audio Frame built is inserted head or the tail region of audio file.
Read a method for audio file copyright information, the method comprises:
Read the Frame in audio file, search copyright indexing head, extract virtual audio Frame;
Adopt the decipherment algorithm corresponding with the cryptographic algorithm be encrypted original copyright information, the virtual audio Frame extracted is decrypted, obtain the copyright information after deciphering.
Write a device for audio file copyright information, this device comprises ciphering unit, construction unit and plug-in unit;
Described ciphering unit, for being encrypted original copyright information, obtaining copyright ciphertext, sending described construction unit to;
Described construction unit, for adding copyright indexing head for copyright ciphertext, build virtual audio Frame by the copyright ciphertext adding copyright indexing head, virtual audio Frame empty part quiet data is filled, and sends virtual audio Frame to described plug-in unit;
Described plug-in unit, for judging whether the quiet region searched out in audio file, if so, then inserts quiet region by the virtual audio Frame of structure; Otherwise the virtual audio Frame built is inserted head or the tail region of audio file.
Read a device for audio file copyright information, it is characterized in that, this device comprises reading unit and decryption unit;
Described reading unit, for reading the Frame in audio file, searches copyright indexing head, extracts virtual audio Frame, sends described decryption unit to;
Described decryption unit, adopts the decipherment algorithm corresponding with the cryptographic algorithm be encrypted original copyright information, is decrypted the virtual audio Frame extracted, and obtains the copyright information after deciphering.
As can be seen from such scheme, the present invention is encrypted original copyright information and obtains copyright ciphertext, and constructs virtual audio Frame by copyright ciphertext, inserts the quiet region in audio file, head or afterbody.Take to encrypt and insert quiet region, the mode of head or afterbody writes copyright information, make copyright information not easily be cracked and wipe, still can play the effect that the ownership of audio file is produced evidence.
Embodiment
Clear for making the object, technical solutions and advantages of the present invention more remove, below in conjunction with embodiment and accompanying drawing, the present invention is described in more detail.
In order to make copyright information not easily be cracked and wipe, the present invention takes to encrypt and insert quiet region, the mode of head or afterbody writes copyright information.See Fig. 1, for the present invention writes the method indicative flowchart of audio file copyright information, it comprises the following steps:
Step 101, is encrypted original copyright information, obtains copyright ciphertext.
Be encrypted original copyright information according to cryptographic algorithm, cryptographic algorithm can be chosen as required, such as hash mapping algorithm or character string cryptographic algorithm etc.
Step 102, for copyright ciphertext adds copyright indexing head, builds virtual audio Frame by the copyright ciphertext adding copyright indexing head, fills virtual audio Frame empty part quiet data.
Copyright indexing head can provide multiple, therefrom selects one when needing.
Virtual audio Frame is identical with the length of other audio data frames, and the playing duration of audio data frame is shorter, is generally less than 0.03 second; Construct virtual audio Frame by the copyright ciphertext adding copyright indexing head, fill blank parts wherein by quiet data, its effect played back is quiet, like this, achieves and carries copyright information with very short quiet of a frame duration.
Step 103, judges whether the quiet region searched out in audio file, if so, then the virtual audio Frame of structure is inserted quiet region; Otherwise the virtual audio Frame built is inserted head or the tail region of audio file.
Afterwards, can read the copyright information in audio file when needed, specifically comprise:
Read the Frame in audio file, search copyright indexing head, extract virtual audio Frame;
With the decipherment algorithm corresponding with cryptographic algorithm described in step 101, the virtual audio Frame extracted is decrypted, obtains the copyright information after deciphering.
After obtaining the copyright information after deciphering, further certification can also be carried out to copyright information, comprise: the copyright information after deciphering and original copyright information be compared, if unanimously, then passes through certification; Otherwise, authentification failure.
Below by Fig. 2,3 and 4 flow process be that the method that audio file writes copyright information is illustrated to the present invention.
See Fig. 2, for the present invention builds the method flow diagram example of virtual audio Frame, it comprises the following steps:
Step 201, is encrypted original copyright information according to cryptographic algorithm, obtains copyright ciphertext.
Be encrypted copyright information, cryptographic algorithm can be selected voluntarily, makes the ciphertext after encrypting be not easy to be resolved out.
Step 202, for copyright ciphertext adds copyright indexing head.
For convenience of later reading, add copyright indexing head, in order to indicate copyright information.
Step 203, the structure according to different audio format defines, and builds virtual audio Frame, fill virtual audio Frame empty part quiet data by the copyright ciphertext adding copyright indexing head.
Structure according to different audio format defines, and builds audio data frame, with fixing algorithm, copyright ciphertext character string quiet data is filled, is written in audio data frame together, this completes the structure of virtual audio Frame.Generally, the length of an audio data frame is about hundreds of byte, and playing duration is less than 0.03 second.
See Fig. 3, for the present invention inserts the method flow diagram example of virtual audio Frame in audio file, it comprises the following steps:
Step 301, the quiet region in search audio file, if search for successfully, then performs step 302, otherwise performs step 303.
Step 302, inserts quiet region by the virtual audio Frame of structure.
Step 303, inserts head or the tail region of audio file by the virtual audio Frame built.
After building virtual audio Frame, need the correct position be inserted into by this frame in audio file.The method inserted is the quiet region first found in audio file, has certain quiet region in general one first song; If can not find, then it directly can be inserted into head or the tail region of audio file.
See Fig. 4, for the present invention reads the method flow diagram example of copyright information from audio file, it comprises the following steps:
Step 401, reads the Frame in audio file.
Step 402, searches copyright indexing head, if search successfully, then performs step 403; Otherwise perform step 405.
Step 403, extracts virtual audio Frame, is decrypted with the decipherment algorithm corresponding with described cryptographic algorithm to the virtual audio Frame extracted, and obtains the copyright information after deciphering.
Step 404, compares the copyright information after deciphering and original copyright information, if unanimously, then by certification, and process ends; Otherwise authentication failed, process ends.
Step 405, judges whether current data frame is last frame, if so, then and process ends; Otherwise return step 401.
When reading copyright information, first the audio data frame in audio file is read in order, at the content search copyright indexing head of frame, if found, then press the Frame construction method reduction copyright information of Fig. 2 flow process, compare with the original copyright information originally write after decrypting ciphertext, if be identical content, then by certification, if not identical content, then authentification failure.
The present invention is encrypted original copyright information and obtains copyright ciphertext, and constructs virtual audio Frame by copyright ciphertext, inserts the quiet region in audio file, head or afterbody.The mode of encrypting copyright information and filling quiet data is taked to build audio data frame, improve the security of copyright information, and, the mode inserting quiet region is adopted to write copyright information, the method that non-audio data is removed in existing employing can not remove copyright information wherein, make copyright information not easily be cracked and wipe, still can play the effect that the ownership of audio file is produced evidence.Meanwhile, because virtual audio Frame is one section very short quiet on music presents, original music content can not be affected, there is good practicality.
See Fig. 5, for the present invention writes the apparatus structure schematic diagram of audio file copyright information, this device comprises ciphering unit, construction unit and plug-in unit;
Described ciphering unit, for being encrypted original copyright information, obtaining copyright ciphertext, sending described construction unit to;
Described construction unit, for adding copyright indexing head for copyright ciphertext, build virtual audio Frame by the copyright ciphertext adding copyright indexing head, virtual audio Frame empty part quiet data is filled, and sends virtual audio Frame to described plug-in unit;
Described plug-in unit, for judging whether the quiet region searched out in audio file, if so, then inserts quiet region by the virtual audio Frame of structure; Otherwise the virtual audio Frame built is inserted head or the tail region of audio file.
See Fig. 6, for the present invention reads the device of audio file copyright information, this device comprises reading unit and decryption unit;
Described reading unit, for reading the Frame in audio file, searches copyright indexing head, extracts virtual audio Frame, sends described decryption unit to;
Described decryption unit, adopts the decipherment algorithm corresponding with the cryptographic algorithm be encrypted original copyright information, is decrypted the virtual audio Frame extracted, and obtains the copyright information after deciphering.
Alternatively, this device also comprises authentication ' unit, for obtaining the copyright information after deciphering from described decryption unit, the copyright information after deciphering and original copyright information being compared, if unanimously, then passing through certification.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.