WO2019001082A1 - 一种视频流地址的鉴权方法及装置 - Google Patents

一种视频流地址的鉴权方法及装置 Download PDF

Info

Publication number
WO2019001082A1
WO2019001082A1 PCT/CN2018/082500 CN2018082500W WO2019001082A1 WO 2019001082 A1 WO2019001082 A1 WO 2019001082A1 CN 2018082500 W CN2018082500 W CN 2018082500W WO 2019001082 A1 WO2019001082 A1 WO 2019001082A1
Authority
WO
WIPO (PCT)
Prior art keywords
authentication value
authentication
information
client
video stream
Prior art date
Application number
PCT/CN2018/082500
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 武汉斗鱼网络科技有限公司
Publication of WO2019001082A1 publication Critical patent/WO2019001082A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25866Management of end-user data
    • H04N21/25875Management of end-user data involving end-user authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/254Management at additional data server, e.g. shopping server, rights management server
    • H04N21/2541Rights Management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25808Management of client data
    • H04N21/25816Management of client data involving client authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/26606Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel for generating or managing entitlement messages, e.g. Entitlement Control Message [ECM] or Entitlement Management Message [EMM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
    • H04N21/4627Rights management associated to the content

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for authenticating a video stream address.
  • Video playback is performed through the Internet and streaming media technology. It is usually necessary to obtain the video stream address for video playback.
  • the video stream address of the video content is not protected, so that the video stream address is easily obtained by the hacker, so that the hacker can obtain the video content without any authorization, thereby winding around.
  • the video site of the provider has been reduced, reducing the traffic of the video site.
  • the related art adopts a method of authenticating a video stream address to protect a video stream address.
  • the encryption algorithm used for authentication is easily acquired, so that the security is low. Therefore, the method for authenticating the video stream address in the prior art has low security.
  • the embodiment of the invention provides a method and a device for authenticating a video stream address, which are used to solve the method for authenticating a video stream address in the prior art, and have the technical problem of low security.
  • the present invention provides a method for authenticating a video stream address, including:
  • Transmitting the first information and the first authentication value to a server where the server determines a second authentication value by using the encryption algorithm and the first information, and determines the first authentication value Whether the second authentication value matches the second authentication value, wherein when the first authentication value matches the second authentication value, the client authenticates by using the video stream address.
  • the method before the obtaining the first authentication value based on the first information for authenticating and the LUA script, the method further includes:
  • the LUA script is stored in an open source in-memory database.
  • the method before the obtaining the first authentication value based on the first information for authenticating and the LUA script, the method further includes:
  • a first authentication value including:
  • the LUA engine is started to execute the LUA script, and an execution result is obtained, and the execution result is used as the first authentication value.
  • a second aspect of the present invention provides a method for authenticating a video stream address, including:
  • the server authenticates the video stream address through the client
  • the server causes the video stream address authentication to not pass through the client.
  • the method further includes:
  • the method before the sending the LUA script to the client, the method further includes:
  • the updated LUA script is sent to the client to update the encryption algorithm in the client.
  • the third aspect of the present invention provides an authentication device for a video stream address, where the device is a client, and includes:
  • An obtaining module configured to acquire first information used for authentication
  • Obtaining a module configured to obtain a first authentication value based on the first information and a pre-received LUA script, where the LUA script is pre-sent to the client by a server, where the LUA script includes a video stream address in advance Code of the encryption algorithm;
  • a sending module configured to send the first information and the first authentication value to a server, where the server determines, by using the encryption algorithm and the first information, a second authentication value, and determines the Whether the first authentication value matches the second authentication value, wherein when the first authentication value matches the second authentication value, the client authenticates by using the video stream address.
  • a fourth aspect of the present invention provides an authentication device for a video stream address, where the device is a server, including:
  • a sending module configured to send, in advance, an LUA script including an encryption algorithm code of a video stream address to the client;
  • a receiving module configured to receive, by the client, first information for authentication and a first authentication value, where the first authentication value is that the client is based on the first information and the LUA script Obtained
  • Obtaining a module configured to obtain a second authentication value based on the first information and the authentication algorithm
  • a determining module configured to determine whether the first authentication value matches the second authentication value
  • a first processing module configured to: when the first authentication value matches the second authentication value, the server authenticates the video stream address through the client;
  • the second processing module is configured to: when the first authentication value does not match the second authentication value, the server causes the video stream address to be authenticated not to pass through the client.
  • a fifth aspect of the present invention provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the following steps:
  • Transmitting the first information and the first authentication value to a server where the server determines a second authentication value by using the encryption algorithm and the first information, and determines the first authentication value Whether the second authentication value matches the second authentication value, wherein when the first authentication value matches the second authentication value, the client authenticates by using the video stream address.
  • a sixth aspect of the invention provides a computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the following step:
  • Transmitting the first information and the first authentication value to a server where the server determines a second authentication value by using the encryption algorithm and the first information, and determines the first authentication value Whether the second authentication value matches the second authentication value, wherein when the first authentication value matches the second authentication value, the client authenticates by using the video stream address.
  • the client acquires first information for authentication; and obtains a first authentication value based on the first information and a pre-received LUA script, where the LUA script is
  • the server sends the code to the client in advance, the LUA script includes a code of an encryption algorithm of the video stream address; and sends the first information and the first authentication value to a server, where the server passes the encryption algorithm and the Determining, by the first information, a second authentication value, and determining whether the first authentication value matches the second authentication value, where the first authentication value and the second authentication value When matching, the client authenticates through the video stream address.
  • the encryption algorithm is first in the LUA script, so that it is not easy to be exposed.
  • the LUA script is open source code, the amount of code is large, and the amount of code including the encryption algorithm can be expanded, so that when the encryption algorithm of the video stream address needs to be cracked, the authentication algorithm has to be copied from the LUA script with a large amount of code. Therefore, it increases the difficulty of cracking.
  • the client is the first authentication value calculated according to the first information and the encryption algorithm
  • the server is also the second authentication value obtained according to the same method, so only the first authentication value and the second authentication value are
  • the server authenticates the client through the client, thereby improving the reliability of the authentication, and solving the technical problem of low security in the method for authenticating the video stream address in the prior art.
  • FIG. 1 is a flowchart of a method for authenticating a video stream address according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another method for authenticating a video stream address according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of an apparatus for authenticating a video stream address according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of another video stream address authentication apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
  • the embodiment of the present application provides a video stream address authentication method and device, which is used to solve the video stream address authentication method in the prior art, and has low security technical problems, thereby improving video stream address authentication.
  • the technical effect of the safety of the method is provided.
  • first information for authentication Obtaining first information for authentication; obtaining a first authentication value based on the first information and a pre-received LUA script, where the LUA script is sent to the client in advance by the server, in the LUA script a code of an encryption algorithm that includes a video stream address in advance; transmitting the first information and the first authentication value to a server, for the server to determine a second authentication by using the encryption algorithm and the first information a value, and determining whether the first authentication value matches the second authentication value, wherein when the first authentication value matches the second authentication value, the client uses the video stream address to check right.
  • the encryption algorithm is first in the LUA script, thereby It is not easy to expose, and the LUA script is open source code, the amount of code is large, and the amount of code including the encryption algorithm can be expanded, so that when the encryption algorithm of the video stream address needs to be cracked, it has to be copied from the LUA script with a large amount of code.
  • the authentication algorithm increases the difficulty of cracking.
  • the client is the first authentication value calculated according to the first information and the encryption algorithm
  • the server is also the second authentication value obtained according to the same method, so only the first authentication value and the second authentication value are
  • the server authenticates the client through the client, thereby improving the reliability of the authentication, and solving the technical problem of low security in the method for authenticating the video stream address in the prior art.
  • This embodiment provides a method for authenticating a video stream address. As shown in FIG. 1, the method includes:
  • Step S101 acquiring first information for authentication
  • Step S102 Obtain a first authentication value based on the first information and a pre-received LUA script, where the LUA script is sent to the client in advance by the server, where the LUA script includes an encryption of a video stream address in advance.
  • Step S103 Send the first information and the first authentication value to the server, so that the server determines the second authentication value by using the encryption algorithm and the first information, and determines the first Whether the authentication value matches the second authentication value, wherein when the first authentication value matches the second authentication value, the client authenticates by using the video stream address.
  • the method provided in this embodiment is applied to a client, where the client and the server are connected through a network to implement communication; in a specific implementation process, the client may be applied to a mobile terminal device (for example, a mobile phone or a tablet computer can also be applied to a fixed terminal device (for example, a desktop computer), and is not limited herein.
  • the server is a server for processing video information.
  • step S101 is performed to acquire first information for authentication.
  • the first information used for authentication is related information for requesting a video stream address of the target video, and the target video may be a live video or another video.
  • the first information is used by the server to authenticate the client, and the user requests the target video from the server.
  • the first information used for authentication includes authentication information of the user identity, a unique identifier of the client device, a network address of the client, and time information of the system.
  • the information includes the authentication information of the current user, that is, the Token obtained by the user when logging in, the room number requested by the user, and the uniqueness of the client device.
  • the identifier that is, the device ID, the IP address of the client (Internet Protocol address, Internet Protocol) address, and the current time of the system.
  • step S102 is performed: obtaining a first authentication value based on the first information and the LUA script received in advance, wherein the LUA script is sent to the client in advance by the server, and the video stream address is included in the LUA script in advance.
  • the code for the encryption algorithm is not limited to: obtaining a first authentication value based on the first information and the LUA script received in advance, wherein the LUA script is sent to the client in advance by the server, and the video stream address is included in the LUA script in advance.
  • the client calculates the first result according to the encryption algorithm of the video stream address, and then the server also calculates the second result by using the above encryption algorithm, and then compares the first result with the server. Whether the second result is consistent for authentication.
  • video playback is usually played by Flash
  • the authentication of its stream address is mostly written using Flash code.
  • the Flash code is written using the ActionScript scripting language, the code is very easy to be decompiled, and the hacker decompiles. There is a security risk that the encryption algorithm of the video stream address in the Flash code can be easily obtained.
  • the code of the encryption algorithm of the video stream address is written in the LUA script.
  • the client is not directly receiving the encryption algorithm, but the LUA script, which needs to execute the LUA script to get the encryption algorithm, and the LUA script is open source code, the code is large, and the amount of code including the encryption algorithm can be expanded, so when needed When cracking the encryption algorithm of the video stream address, the authentication algorithm has to be copied from the LUA script with a large amount of code, thus increasing the difficulty of cracking.
  • the method further includes:
  • the LUA script is stored in an open source in-memory database.
  • the LUA script can be first stored in the open source in-memory database. Since the open source in-memory database is used, the code amount is further enlarged, so that the video stream address is encrypted. The amount of code is increased to further improve the difficulty of cracking.
  • the above open source in-memory database can be Redis, MongoDB, etc., in the case of Redis, it is an open source database written in C language, and is based on memory Key-Value. Because Redis uses open source code, and Redis uses complex data structures to store data, it increases the difficulty of cracking encryption algorithms used for authentication in LUA scripts.
  • the Redis storage LUA script can expand the complexity and code amount of the encryption algorithm of the video stream address.
  • the LUA script can be stored by calling the interface provided by the Redis source code.
  • the specific implementation code is as follows:
  • Redis.set is the interface provided by Redis to store data.
  • LUA is the key value for storing LUA scripts.
  • Plua is the data pointed to by the key LUA, that is, the received LUA script.
  • the method further includes:
  • the LUA script is obtained from the open source in-memory database.
  • a first authentication value including:
  • the LUA engine is started to execute the LUA script, and an execution result is obtained, and the execution result is used as the first authentication value.
  • the client first needs to obtain the LUA script, and because the LUA script is stored in the open-source in-memory database, the LUA script needs to be obtained from the open source in-memory database.
  • the first information may be spliced to obtain a first parameter, which may be Token+Roomid+ID+IP+Time; the first authentication value may be implemented by:
  • NEWKEY Luaengine.excute(plua,Token+Roomid+ID+IP+Time);
  • Luaengine.excute is the interface of the LUA engine to execute LUA scripts
  • the parameter plua is a LUA script
  • the parameter Token+Roomid+ID+IP+Time is used for the first information of the authentication.
  • the Redis is used to store the first authentication value calculated by the foregoing.
  • the first authentication value is removed from the Redis and sent to the server.
  • step S103 the first information and the first authentication value are sent to the server, so that the server determines the second authentication value by using the encryption algorithm and the representation first information, and determines the location. Whether the first authentication value matches the second authentication value, wherein when the first authentication value matches the second authentication value, the client authenticates by using the video stream address.
  • the server authenticates the client and sends the video stream address of the target video to the client. Conversely, when the first authentication value does not match the second authentication value, the server authentication does not pass through the client, and the video stream address of the target video is rejected from being sent to the client.
  • the second authentication value calculated by the server is based on the same encryption algorithm and usage as the client.
  • the first information obtained by the authentication is obtained, so the second authentication value of the server should match the first authentication value of the client. If the client does not match, the client is a forged or illegal client, and the authentication is performed. If the match is not made, the video stream address is authenticated and the client receives the video stream address of the target video, so that the video stream is normally viewed.
  • the present application further provides a method for authenticating a video stream address, which is applied to a server.
  • a method for authenticating a video stream address which is applied to a server.
  • This embodiment provides a method for authenticating a video stream address. As shown in FIG. 2, the method includes:
  • Step S201 the LUA script including the code of the video stream address encryption algorithm is sent to the client in advance;
  • Step S202 receiving first information for authentication and a first authentication value sent by the client, where the first authentication value is obtained by the client based on the first information and the LUA script of;
  • Step S203 obtaining a second authentication value based on the first information and the encryption algorithm
  • Step S204 determining whether the first authentication value and the second authentication value match
  • Step S205 when the first authentication value matches the second authentication value, the server authenticates the video stream address through the client;
  • Step S206 When the first authentication value does not match the second authentication value, the server causes the video stream address to be authenticated not to pass through the client.
  • the method provided in this embodiment is applied to a server, and the server is connected to the client through a network to implement communication; in a specific implementation process, the client may be applied to a mobile terminal device (for example, Mobile phones, tablets) can also be applied to fixed terminal devices (such as desktop computers), and are not limited herein.
  • the server is a server for processing video information, and may be a separate server or a server group composed of multiple servers.
  • step S201 the LUA script including the encryption algorithm code of the video stream address is sent to the client in advance;
  • the present invention in order to improve the difficulty of obtaining or cracking the encryption algorithm, the present invention firstly writes the code of the encryption algorithm of the video stream address to the LUA script in advance on the server side, and then sends the LUA script containing the encryption algorithm to the client. Since the encryption algorithm is not directly sent to the client, the security of the encryption algorithm can be improved, and the LUA script is open source code, which can improve the amount of code for cracking the encryption algorithm, so that when it is necessary to crack the encryption algorithm of the video stream address, it has to The LUA script with a large amount of code copies the authentication algorithm, which increases the difficulty of cracking.
  • step S202 the first information sent by the client and the first authentication value are received, where the first authentication value is the first information that the client passes through the LUA script and the authentication is used. acquired.
  • step S203 is performed: obtaining a second authentication value based on the first information and the encryption algorithm.
  • the method for obtaining the second authentication value is the same as the method for obtaining the first authentication value, and is not described here.
  • step S204 is performed: determining whether the first authentication value and the second authentication value match.
  • the determining whether the first authentication value and the second authentication value match may be: determining whether the first authentication value and the second authentication value are the same, or determining Whether the first authentication value and the second authentication value are equal.
  • step S205 the server authenticates the video stream address through the client. Further, after the server passes the authentication, the server also sends the video stream address of the target video to the client.
  • step S206 the server causes the video stream address authentication to not pass through the client.
  • the server uses the same encryption algorithm as the client and the first information for authentication, the second authentication value of the video stream address is calculated. Therefore, the server obtains the second authentication value that should match the first authentication value of the client. If the client does not match, the client is a forged or illegal client, and the authentication fails. If it is matched, then Sending, to the client, a video stream address corresponding to the first information for authentication, and authenticating through the client.
  • the method before the sending the LUA script to the client, the method further includes:
  • the updated LUA script is sent to the client to update the encryption algorithm in the client.
  • the code of the encryption algorithm pre-written with the video stream address is used in the LUA script
  • the LUA script is a script language, which is an interpreted execution language, and can be executed without recompiling.
  • the encryption algorithm in the LUA script can be updated by updating the LUA script, and the server sends the updated LUA script to the client, so that the encryption algorithm in the client can be updated.
  • the method of updating the LUA script can adopt a random update method, so if the hacker wants to obtain the encryption algorithm, it needs to acquire all the LUA scripts, and obtain the encryption algorithm from the LUA script, thereby further improving the difficulty of cracking the encryption algorithm.
  • the first information for authentication includes: authentication information of the user identity, a unique identifier of the client device, a network address of the client, and time information of the system. .
  • the method introduced in the second embodiment of the present invention is the same as the method in the first embodiment. Based on the first embodiment, those skilled in the art should understand the implementation steps and principles of the method provided in the second embodiment, and therefore no longer Narration.
  • the present application further provides an apparatus corresponding to the authentication method of the video stream address in the first embodiment.
  • an apparatus corresponding to the authentication method of the video stream address in the first embodiment.
  • the embodiment provides a device for authenticating a video stream address, and the device is a client. As shown in FIG. 3, the device includes:
  • An obtaining module 301 configured to acquire first information used for authentication
  • the obtaining module 302 is configured to obtain a first authentication value based on the first information and a pre-received LUA script, where the LUA script is sent to the client in advance, where the LUA script includes a video stream in advance The code of the address encryption algorithm;
  • a sending module 303 configured to send the first information for authentication and the first authentication value to a server, where the server passes the authentication algorithm and the first information used for authentication Determining a second authentication value and determining whether the first authentication value matches the second authentication value.
  • the device introduced in the third embodiment of the present invention is a device used in the method for authenticating the video stream address according to the first embodiment of the present invention. Therefore, those skilled in the art can understand the device according to the method described in the first embodiment of the present invention. The specific structure and deformation of the device are not described herein.
  • the apparatus used in the method of the first embodiment of the present invention is within the scope of the present invention.
  • the present application further provides an apparatus corresponding to the authentication method of the video stream address in the second embodiment.
  • an apparatus corresponding to the authentication method of the video stream address in the second embodiment.
  • the embodiment provides a device for authenticating a video stream address, and the device is a server. As shown in FIG. 4, the device includes:
  • a sending module 401 configured to send, in advance, an LUA script including an encryption algorithm code of a video stream address to a client;
  • the receiving module 402 is configured to receive, by the client, first information for authentication and a first authentication value, where the first authentication value is the first time that the client passes the authentication Information obtained by the LUA script;
  • the obtaining module 403 is configured to obtain a second authentication value based on the first information used for authentication and the authentication algorithm
  • the determining module 404 is configured to determine whether the first authentication value and the second authentication value match
  • the first processing module 405 is configured to: when the first authentication value matches the second authentication value, the server authenticates the video stream address through the client;
  • the second processing module 406 is configured to: when the first authentication value does not match the second authentication value, the server causes the video stream address to be authenticated not to pass through the client.
  • the apparatus further includes a third processing module, after the authenticating passes the client,
  • the device introduced in the fourth embodiment of the present invention is a device used in the method for authenticating the video stream address according to the second embodiment of the present invention. Therefore, those skilled in the art can understand the device according to the method described in the second embodiment of the present invention. The specific structure and deformation of the device are not described herein.
  • the apparatus used in the method of the second embodiment of the present invention is within the scope of the present invention.
  • the present application also provides a computer readable storage medium having stored thereon a computer program, the program being executed by the processor to implement the following steps:
  • the present application also provides a computer device, see FIG. 5, including a storage 501, a processor 502, and a computer program 503 stored on the memory and executable on the processor, the processor 502 executing The program implements the following steps:
  • the memory 501 can be used to store a computer program 503 comprising software programs, modules and data, and the processor 502 executes a computer program 503 stored in the memory 501 by execution to perform various functional applications and data processing of the electronic device.
  • the memory 501 can be used to store software programs and modules, and the processor 502 executes various functional applications and data processing of the electronic device by running software programs and modules stored in the memory 501.
  • the memory 501 may mainly include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application 5 required for at least one function, and the like; the storage data area may store data created according to usage of the electronic device 5, etc. .
  • the memory 501 may include a high speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the processor 502 is a control center of the electronic device that connects various portions of the entire electronic device using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 501, and recalling data stored in the memory 501. , performing various functions and processing data of the electronic device to perform overall monitoring of the electronic device.
  • the processor 502 may include one or more processing units; preferably, the processor 502 may integrate an application processor, wherein the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the first information for authentication is obtained by the client; and the first authentication value is obtained based on the first information for authentication and the LUA script received in advance, where
  • the LUA script is sent to the client in advance by the server, and the LUA script includes an encryption algorithm of the video stream address in advance; sending the first information for authentication and the first authentication value to the server, to Determining, by the server, the second authentication value by using the encryption algorithm and the first information for authentication, and determining whether the first authentication value matches the second authentication value, where When the first authentication value matches the second authentication value, the client passes the authentication.
  • the above encryption algorithm is first in the LUA script.
  • the LUA script is open source code
  • the amount of code is large, and the amount of code including the encryption algorithm can be expanded, so that when the encryption algorithm of the video stream address needs to be cracked, the LUA script having a large amount of code has to be
  • the authentication algorithm is copied in, which increases the difficulty of cracking.
  • the client is the first authentication value calculated according to the first information used for authentication and the authentication algorithm
  • the server is also the second authentication value obtained according to the same method, so only the first authentication value is
  • the server authenticates the client through the client, thereby improving the reliability of the authentication, and solving the technical problem of low security in the method for authenticating the video stream address in the prior art.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Graphics (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本发明实施例提供了一种视频流地址的鉴权方法及装置,所述鉴权方法包括:获取用于鉴权的第一信息;基于所述用于鉴权的第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法;发送所述用于鉴权的第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。本发明解决了现有技术中视频流地址鉴权的方法,存在安全性较低的技术问题。

Description

一种视频流地址的鉴权方法及装置 技术领域
本发明涉及计算机技术领域,尤其涉及一种视频流地址的鉴权方法及装置。
背景技术
视频播放是通过互联网及流媒体技术进行的,通常需要获取视频流地址从而进行视频的播放。
然而,对视频内容的提供方而言,由于没有对播放视频内容的视频流地址采取保护措施,其视频流地址容易被黑客获取,这样黑客不经过任何的授权就可以获取上述视频内容,从而绕过了提供方的视频网站,减少了视频网站的流量。
为了解决上述问题,相关技术采用了对视频流地址鉴权的方法来保护视频流地址。然而,现有的视频流地址的鉴权方法中,用于鉴权的加密算法容易被获取,从而安全性较低,因此,现有技术中视频流地址鉴权的方法,存在安全性较低的技术问题。
发明内容
本发明实施例提供了一种视频流地址的鉴权方法及装置,用以解决现有技术中视频流地址鉴权的方法,存在的安全性较低的技术问题。
第一方面,本发明提供了一种视频流地址的鉴权方法,包括:
获取用于鉴权的第一信息;
基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
可选地,在所述基于所述用于鉴权的第一信息和所述LUA脚本,获得第一鉴权值之前,所述方法还包括:
在开源的内存数据库中存储所述LUA脚本。
可选地,在所述基于所述用于鉴权的第一信息和所述LUA脚本,获得第一 鉴权值之前,所述方法还包括:
从所述开源的内存数据库中获取所述LUA脚本;
所述基于所述第一信息和所述LUA脚本,获得第一鉴权值,包括:
将所述第一信息作为执行LUA脚本的第一参数,启动LUA引擎执行所述LUA脚本,获得执行结果,以所述执行结果作为所述第一鉴权值。
基于同样的发明构思,本发明第二方面提供了一种视频流地址的鉴权方法,包括:
预先将包括视频流地址的加密算法代码的LUA脚本发送至客户端;
接收客户端发送的用于鉴权的第一信息和第一鉴权值,其中,所述第一鉴权值是所述客户端基于所述第一信息和所述LUA脚本而获得的;
基于所述第一信息和所述加密算法,获得第二鉴权值;
判断所述第一鉴权值与所述第二鉴权值是否匹配;
当所述第一鉴权值与所述第二鉴权值匹配时,所述服务器使视频流地址鉴权通过所述客户端;
当所述第一鉴权值与所述第二鉴权值不匹配时,所述服务器使视频流地址鉴权不通过所述客户端。
可选地,在所述服务器使视频流地址鉴权通过所述客户端之后,所述方法还包括:
向所述客户端发送所述目标视频的视频流地址。
可选地,在所述发送LUA脚本至客户端之前,所述方法还包括:
更新LUA脚本;
将更新后的所述LUA脚本发送到所述客户端,以更新所述客户端中的加密算法。
基于同样的发明构思,本发明第三方面提供了一种视频流地址的鉴权装置,所述装置为客户端,包括:
获取模块,用于获取用于鉴权的第一信息;
获得模块,用于基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
发送模块,用于发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
基于同样的发明构思,本发明第四方面提供了一种视频流地址的鉴权装 置,所述装置为服务器,包括:
发送模块,用于预先将包括视频流地址的加密算法代码的LUA脚本发送至客户端;
接收模块,用于接收客户端发送的用于鉴权的第一信息和第一鉴权值,其中,所述第一鉴权值是所述客户端基于所述第一信息和所述LUA脚本而获得的;
获得模块,用于基于所述第一信息和所述鉴权算法,获得第二鉴权值;
判断模块,用于判断所述第一鉴权值与所述第二鉴权值是否匹配;
第一处理模块,用于当所述第一鉴权值与所述第二鉴权值匹配时,所述服务器使视频流地址鉴权通过所述客户端;
第二处理模块,用于当所述第一鉴权值与所述第二鉴权值不匹配时,所述服务器使视频流地址鉴权不通过所述客户端。
基于同样的发明构思,本发明第五方面提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以下步骤:
获取用于鉴权的第一信息;
基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
基于同样的发明构思,本发明第六方面提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下步骤:
获取用于鉴权的第一信息;
基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
本申请实施例中的上述一个或多个技术方案,至少具有如下一种或多种技 术效果:
在本发明实施例的技术方案中,客户端获取用于鉴权的第一信息;基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本包括视频流地址的加密算法的代码;发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。由于客户端的第一鉴权值是根据第一信息和预先接收的LUA脚本得出的,而LUA脚本中预先包括视频流地址的加密算法,首先上述加密算法是在LUA脚本中,从而不容易暴露,并且LUA脚本是开源的代码,代码量大,可以扩大包含加密算法的代码量,这样当需要破解视频流地址的加密算法时,不得不从代码量很大的LUA脚本中拷贝出鉴权算法,故而增加了破解难度。并且,客户端是根据第一信息和加密算法计算出的第一鉴权值,服务器也是根据同样的方法得出的第二鉴权值,因此只有第一鉴权值与第二鉴权值相匹配时,服务器才会鉴权通过客户端,从而提高了鉴权的可靠性,解决了现有技术中视频流地址鉴权的方法中安全性较低的技术问题。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例中一种视频流地址的鉴权方法的流程图;
图2为本发明实施例中另一种视频流地址的鉴权方法的流程图;
图3为本发明实施例中一种视频流地址的鉴权装置的结构示意图;
图4为本发明实施例中另一种视频流地址的鉴权装置的结构示意图;
图5为本发明实施例中一种计算机设备的结构示意图。
具体实施方式
本申请实施例通过提供一种视频流地址的鉴权方法及装置,用以解决现有技术中视频流地址鉴权的方法,存在的安全性低的技术问题,实现了提高视频 流地址鉴权方法的安全性的技术效果。
本申请实施例中的技术方案,总体思路如下:
获取用于鉴权的第一信息;基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
上述方法中由于客户端的第一鉴权值是根据第一信息和预先接收的LUA脚本得出的,而LUA脚本中预先包括视频流地址的加密算法,首先上述加密算法是在LUA脚本中,从而不容易暴露,并且LUA脚本是开源的代码,代码量大,可以扩大包含加密算法的代码量,这样当需要破解视频流地址的加密算法时,不得不从代码量很大的LUA脚本中拷贝出鉴权算法,故而增加了破解难度。并且,客户端是根据第一信息和加密算法计算出的第一鉴权值,服务器也是根据同样的方法得出的第二鉴权值,因此只有第一鉴权值与第二鉴权值相匹配时,服务器才会鉴权通过客户端,从而提高了鉴权的可靠性,解决了现有技术中视频流地址鉴权的方法中安全性较低的技术问题。
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
实施例一
本实施例提供一种视频流地址的鉴权方法,如图1所示,该方法包括:
步骤S101,获取用于鉴权的第一信息;
步骤S102,基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
步骤S103,发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
需要说明的是,本实施例提供的方法应用于客户端,所述客户端与所述服务器通过网络进行连接,以实现通信;在具体实施过程中,所述客户端可以应 用于移动终端设备(例如手机、平板电脑),也可以应用于固定终端设备(例如台式机),在此也不作限制。所述服务器是用于处理视频信息的服务器。
下面,结合图1详细介绍本申请实施例提供的视频流地址的鉴权方法的实施步骤。
首先,执行步骤S101,获取用于鉴权的第一信息。
在本申请实施例中,用于鉴权的第一信息是用来请求目标视频的视频流地址的相关信息,目标视频可以是直播视频也可以是其他视频。第一信息用于供服务器对客户端进行鉴权,以及用户向服务器请求目标视频。其中,用于鉴权的第一信息包括用户身份的认证信息、客户端设备的唯一标识、客户端的网络地址和系统的时间信息。以直播视频为例,需要请求观看的直播视频的客户端需要获取第一信息,上述信息包括当前用户的认证信息,即用户登陆时获取的Token,用户请求的房间号Roomid,客户端设备的唯一标识,即设备ID,客户端的IP地址(网络协议地址,Internet Protocol)地址和系统的当前时间Time。
然后执行步骤S102:基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码。
具体来说,现有技术中的鉴权方法中,客户端根据视频流地址的加密算法计算出第一结果,然后服务器也通过上述加密算法计算出第二结果,然后通过服务器比较第一结果与第二结果是否一致来进行鉴权。而由于视频播放通常采用Flash来播放,则其流地址的鉴权也大多使用Flash的代码来编写,由于Flash的代码是使用ActionScript脚本语言来编写,其代码非常容易被反编译,黑客通过反编译可以轻易地获取Flash代码中的视频流地址的加密算法,从而存在安全风险。而本发明的实施方式中,客户端接收的服务器预先发送的LUA脚本中,将视频流地址的加密算法的代码编写在LUA脚本中。那么,客户端不是直接接收的加密算法,而是LUA脚本,需要执行LUA脚本才能得出加密算法,并且LUA脚本是开源的代码,代码量大,可以扩大包含加密算法的代码量,这样当需要破解视频流地址的加密算法时,不得不从代码量很大的LUA脚本中拷贝出鉴权算法,故而增加了破解难度。
为了进一步提高视频流地址的破解难度,在所述基于所述第一信息和所述LUA脚本,获得第一鉴权值之前,所述方法还包括:
在开源的内存数据库中存储所述LUA脚本。
具体来说,当客户端接收到服务器发送的LUA脚本,可以首先将LUA脚本存储于开源的内存数据库中,由于采用开源的内存数据库,则会进一步扩大代码量,使得视频流地址的加密算法的代码量增大,进一步提高破解难度。举例来 说,上述开源的内存数据库可以为Redis、MongoDB等等,以Redis为例,它是一个开源的使用C语言编写的数据库,并且是基于内存Key-Value的。由于Redis采用开源的代码,且Redis会采用复杂的数据结构来存储数据,故而增加LUA脚本中用于鉴权的加密算法的破解难度。另外相对于现有技术中直接采用变量来存储加密算法而言,利用Redis存储LUA脚本可以扩大视频流地址的加密算法的复杂度和代码量。
在具体的实施过程中,可以通过调用Redis源码提供的接口来存储LUA脚本,具体的实现代码如下:
Redis.set(“LUA”,plua);
其中,Redis.set是Redis提供的存储数据的接口。
“LUA”是存储LUA脚本的键值。
plua则是键值LUA指向的数据,即接收到的LUA脚本。
具体地,在所述基于所述用于鉴权的第一信息和所述LUA脚本,获得第一鉴权值之前,所述方法还包括:
从所述开源的内存数据库中获取所述LUA脚本。
所述基于所述第一信息和所述LUA脚本,获得第一鉴权值,包括:
将所述第一信息作为执行LUA脚本的第一参数,启动LUA引擎执行所述LUA脚本,获得执行结果,以所述执行结果作为所述第一鉴权值。
具体来说,客户端为了获得第一鉴权值,首先需要获取LUA脚本,而由于前面采用开源的内存数据库中存储LUA脚本,则需要从开源的内存数据库中获取所述LUA脚本,具体可以通过调用Redis源码提供的接口来实现:Char*pLua=Redis.get(“LUA”)。然后将所述第一信息作为执行LUA脚本的第一参数,启动LUA引擎执行所述LUA脚本,并将第一参数输入LUA脚本,进而计算获得第一鉴权值。在具体的实施过程中,可以将第一信息拼接得到第一参数,可以为Token+Roomid+ID+IP+Time;第一鉴权值可以通过下述方式实现:
NEWKEY=Luaengine.excute(plua,Token+Roomid+ID+IP+Time);
其中,Luaengine.excute是LUA引擎的执行LUA脚本的接口;
参数plua是LUA脚本;
参数Token+Roomid+ID+IP+Time则用于鉴权的第一信息。
可选地,本实施例中还可以采用Redis来存储上述计算的第一鉴权值,当需要发送给服务器时,再将第一鉴权值从Redis中取出,并发送至服务器。
然后执行步骤S103,发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述表示第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述 第二鉴权值匹配时,客户端通过视频流地址鉴权。
进一步,当第一鉴权值与第二鉴权值匹配时,服务器鉴权通过客户端,并向客户端发送目标视频的视频流地址。反之,当第一鉴权值与第二鉴权值不匹配时,服务器鉴权不通过客户端,并且拒绝向客户端发送目标视频的视频流地址。
具体来讲,客户端发送所述用于鉴权的第一信息和所述第一鉴权值至服务器后,通过服务器计算的第二鉴权值,是根据与客户端相同的加密算法和用于鉴权的第一信息得到的,因此服务器得到第二鉴权值应该与客户端的第一鉴权值是匹配的,如果不匹配则说明客户端是一个伪造或非法的客户端,则鉴权不通过,如果是匹配的,则视频流地址鉴权通过,客户端会接收到目标视频的视频流地址,从而正常的观看视频流。
基于同一发明构思,本申请还提供了一种视频流地址的鉴权方法,应用于服务器,详见实施例二。
实施例二
本实施例提供了一种视频流地址的鉴权方法,如图2所示,该方法包括:
步骤S201,预先将包括视频流地址加密算法的代码的LUA脚本发送至客户端;
步骤S202,接收客户端发送的用于鉴权的第一信息和第一鉴权值,其中,所述第一鉴权值是所述客户端基于所述第一信息和所述LUA脚本而获得的;
步骤S203,基于所述第一信息和所述加密算法,获得第二鉴权值;
步骤S204,判断所述第一鉴权值与所述第二鉴权值是否匹配;
步骤S205,当所述第一鉴权值与所述第二鉴权值匹配时,所述服务器使视频流地址鉴权通过所述客户端;
步骤S206,当所述第一鉴权值与所述第二鉴权值不匹配时,所述服务器使视频流地址鉴权不通过所述客户端。
需要说明的是,本实施例提供的方法应用于服务器,所述服务器与所述客户端通过网络进行连接,以实现通信;在具体实施过程中,所述客户端可以应用于移动终端设备(例如手机、平板电脑),也可以应用于固定终端设备(例如台式机),在此也不作限制。所述服务器是用于处理视频信息的服务器,可以为单独的服务器,也可以为多个服务器组成的服务器组。
下面,结合图2详细介绍本申请实施例提供的视频流地址的鉴权方法的实施步骤。
首先,执行步骤S201,预先将包括视频流地址的加密算法代码的LUA脚本发送至客户端;。
具体来说,本发明为了提高加密算法的获取或者破解难度,首先在服务器端预先将视频流地址的加密算法的代码编写至LUA脚本中,然后再将包含加密算法的LUA脚本发送至客户端,由于不是直接发送加密算法至客户端,可以提高加密算法的安全性,并且LUA脚本是开源的代码,可以提高破解加密算法的代码量,这样当需要破解视频流地址的加密算法时,不得不从代码量很大的LUA脚本中拷贝出鉴权算法,故而增加了破解难度。
然后执行步骤S202,接收客户端发送的第一信息和第一鉴权值,其中,所述第一鉴权值是所述客户端通过所述LUA脚本和所述用于鉴权的第一信息获得的。
在实施例一中已经详细介绍了如何获得第一鉴权值,在此不再赘述。
接着执行步骤S203:基于第一信息和所述加密算法,获得第二鉴权值。
在实施例一中已经详细介绍了如何获得第一鉴权值,而服务器获得第二鉴权值的方法与获得第一鉴权值的方法相同,在此不再赘述。
然后执行步骤S204:判断所述第一鉴权值与所述第二鉴权值是否匹配。
在具体实施过程中,所述判断所述第一鉴权值与所述第二鉴权值是否匹配可以为:判断所述第一鉴权值与所述第二鉴权值是否相同,或判断所述第一鉴权值与所述第二鉴权值是否等值。
当所述第一鉴权值与所述第二鉴权值匹配时,执行步骤S205:所述服务器使视频流地址鉴权通过所述客户端。进一步,服务器在鉴权通过客户端后,还会向客户端发送目标视频的视频流地址。
当所述第一鉴权值与所述第二鉴权值不匹配时,执行步骤S206:所述服务器使视频流地址鉴权不通过所述客户端。
具体来讲,由于在服务器是采用与客户端相同的加密算法和用于鉴权的第一信息,来计算视频流地址的第二鉴权值的。所以,服务器得到第二鉴权值应该与客户端的第一鉴权值是匹配的,如果不匹配则说明客户端是一个伪造或非法的客户端,则鉴权不通过,如果是匹配的,则向所述客户端发送与所述用于鉴权的第一信息对应的视频流地址,鉴权通过所述客户端。
在本实施例中提供的视频流地址的鉴权方法中,在所述发送LUA脚本至客户端之前,所述方法还包括:
更新LUA脚本;
将更新后的所述LUA脚本发送到所述客户端,以更新所述客户端中的加密算法。
具体来说,本发明实施例中由于采用预先编写了视频流地址的加密算法的代码至LUA脚本中,而LUA脚本是脚本语言,是解释性执行的语言,不需要重新 编译则可以执行,本发明中则可以通过更新LUA脚本的方法来更新LUA脚本中的加密算法,服务器将更新后的所述LUA脚本发送到所述客户端,这样就可以更新所述客户端中的加密算法。更新LUA脚本的方法可以采用随机更新的方法,这样如果黑客要获取加密算法,则需要获取所有的LUA脚本,并从LUA脚本中获取加密算法,进一步提高了加密算法的破解难度。
在本实施例中提供的视频流地址的鉴权方法中,所述用于鉴权的第一信息包括:用户身份的认证信息、客户端设备的唯一标识、客户端的网络地址和系统的时间信息。
在实施例一中已经详细介绍了用于鉴权的第一信息的具体内容,在此不再累述。
由于本发明实施例二所介绍的方法与实施例一中所介绍的方法属于同一发明构思,基于实施例一本领域技术人员应该了解实施例二提供方法的实施步骤及原理,故而在此不再赘述。
基于同一发明构思,本申请还提供了与实施例一中视频流地址的鉴权方法对应的装置,详见实施例三。
实施例三
本实施例提供一种视频流地址的鉴权装置,所述装置为客户端,如图3所示,该装置包括:
获取模块301,用于获取用于鉴权的第一信息;
获得模块302,用于基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
发送模块303,用于发送所述用于鉴权的第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述鉴权算法和所述用于鉴权的第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配。
由于本发明实施例三所介绍的装置,为实施本发明实施例一的视频流地址的鉴权方法所采用的装置,故而基于本发明实施例一所介绍的方法,本领域所属人员能够了解该装置的具体结构及变形,故而在此不再赘述。凡是本发明实施例一的方法所采用的装置都属于本发明所欲保护的范围。
基于同一发明构思,本申请还提供了与实施例二中视频流地址的鉴权方法对应的装置,详见实施例四。
实施例四
本实施例提供一种视频流地址的鉴权装置,所述装置为服务器,如图4所示,该装置包括:
发送模块401,用于预先将包括视频流地址的加密算法代码的LUA脚本发送至客户端;
接收模块402,用于接收客户端发送的用于鉴权的第一信息和第一鉴权值,其中,所述第一鉴权值是所述客户端通过所述用于鉴权的第一信息和所述LUA脚本获得的;
获得模块403,用于基于所述用于鉴权的第一信息和所述鉴权算法,获得第二鉴权值;
判断模块404,用于判断所述第一鉴权值与所述第二鉴权值是否匹配;
第一处理模块405,用于当所述第一鉴权值与所述第二鉴权值匹配时,所述服务器使视频流地址鉴权通过所述客户端;
第二处理模块406,用于当所述第一鉴权值与所述第二鉴权值不匹配时,所述服务器使视频流地址鉴权不通过所述客户端。
可选地,所述装置还包括第三处理模块,用于在所述鉴权通过所述客户端之后,
向所述客户端发送所述目标视频的视频流地址。
由于本发明实施例四所介绍的装置,为实施本发明实施例二的视频流地址的鉴权方法所采用的装置,故而基于本发明实施例二所介绍的方法,本领域所属人员能够了解该装置的具体结构及变形,故而在此不再赘述。凡是本发明实施例二的方法所采用的装置都属于本发明所欲保护的范围。
实施例五
基于同一发明构思,本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以下步骤:
获取用于鉴权的第一信息;
基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
发送所述用于鉴权的第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述用于鉴权的第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
实施例六
基于同一发明构思,本申请还提供了一种计算机设备,请参见图5,包括存储501、处理器502及存储在存储器上并可在处理器上运行的计算机程序503,所述处理器502执行所述程序时实现以下步骤:
获取用于鉴权的第一信息;
基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
发送所述用于鉴权的第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述用于鉴权的第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。存储器501可用于存储计算机程序503,上述计算机程序包括软件程序、模块和数据,处理器502通过运行执行存储在存储器501的计算机程序503,从而执行电子设备的各种功能应用以及数据处理。
在具体的实施过程中,存储器501可用于存储软件程序以及模块,处理器502通过运行存储在存储器501的软件程序以及模块,从而执行电子设备的各种功能应用以及数据处理。存储器501可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序5等;存储数据区可存储根据电子设备的使用所创建的数据5等。此外,存储器501可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。处理器502是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器501内的软件程序和/或模块,以及调用存储在存储器501内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。可选的,处理器502可包括一个或多个处理单元;优选的,处理器502可集成应用处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等。
本申请实施例中提供的技术方案,至少具有如下技术效果或优点:
在本发明实施例的技术方案中,通过客户端获取用于鉴权的第一信息;基于所述用于鉴权的第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法;发送所述用于鉴权的第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述用于鉴权的第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过鉴权。由于客户端的第一鉴权值是根据用于鉴权的第一信息和预先接收的LUA脚本得出的,而LUA脚本中预先编 写有视频流地址的加密算法,首先上述加密算法是在LUA脚本中,从而不容易暴露,并且LUA脚本是开源的代码,代码量大,可以扩大包含加密算法的代码量,这样当需要破解视频流地址的加密算法时,不得不从代码量很大的LUA脚本中拷贝出鉴权算法,故而增加了破解难度。并且,客户端是根据用于鉴权的第一信息和鉴权算法计算出的第一鉴权值,服务器也是根据同样的方法得出的第二鉴权值,因此只有第一鉴权值与第二鉴权值相匹配时,服务器才会鉴权通过客户端,从而提高了鉴权的可靠性,解决了现有技术中视频流地址鉴权的方法中安全性较低的技术问题。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和 变型在内。

Claims (10)

  1. 一种视频流地址的鉴权方法,其特征在于,包括:
    获取用于鉴权的第一信息;
    基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
    发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,所述客户端通过视频流地址鉴权。
  2. 如权利要求1所述的方法,其特征在于,在所述基于所述第一信息和所述LUA脚本,获得第一鉴权值之前,所述方法还包括:
    在开源的内存数据库中存储所述LUA脚本。
  3. 如权利要求2所述的方法,其特征在于,在所述基于所述第一信息和所述LUA脚本,获得第一鉴权值之前,所述方法还包括:
    从所述开源的内存数据库中获取所述LUA脚本;
    所述基于所述第一信息和所述LUA脚本,获得第一鉴权值,包括:
    将所述第一信息作为执行LUA脚本的第一参数,启动LUA引擎执行所述LUA脚本,获得执行结果,以所述执行结果作为所述第一鉴权值。
  4. 一种视频流地址的鉴权方法,其特征在于,包括:
    预先将包括视频流地址的加密算法代码的LUA脚本发送至客户端;
    接收客户端发送的用于鉴权的第一信息和第一鉴权值,其中,所述第一鉴权值是所述客户端基于所述第一信息和所述LUA脚本而获得的;
    基于所述第一信息和所述加密算法,获得第二鉴权值;
    判断所述第一鉴权值与所述第二鉴权值是否匹配;
    当所述第一鉴权值与所述第二鉴权值匹配时,所述服务器使视频流地址鉴权通过所述客户端;
    当所述第一鉴权值与所述第二鉴权值不匹配时,所述服务器使视频流地址鉴权不通过所述客户端。
  5. 如权利要求4所述的方法,其特征在于,在所述鉴权通过所述客户端之后,所述方法还包括:
    向所述客户端发送所述目标视频的视频流地址。
  6. 如权利要求4所述的方法,其特征在于,在所述发送LUA脚本至客户端之前,所述方法还包括:
    更新LUA脚本;
    将更新后的所述LUA脚本发送到所述客户端,以更新所述客户端中的加密算法。
  7. 一种视频流地址的鉴权装置,其特征在于,所述装置为客户端,包括:
    获取模块,用于获取用于鉴权的第一信息;
    获得模块,用于基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
    发送模块,用于发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
  8. 一种视频流地址的鉴权装置,其特征在于,所述装置为服务器,包括:
    发送模块,用于预先将包括视频流地址的加密算法代码的LUA脚本发送至客户端;
    接收模块,用于接收客户端发送的用于鉴权的第一信息和第一鉴权值,其中,所述第一鉴权值是所述客户端基于所述第一信息和所述LUA脚本而获得的;
    获得模块,用于基于所述第一信息和所述鉴权算法,获得第二鉴权值;
    判断模块,用于判断所述第一鉴权值与所述第二鉴权值是否匹配;
    第一处理模块,用于当所述第一鉴权值与所述第二鉴权值匹配时,所述服务器使视频流地址鉴权通过所述客户端;
    第二处理模块,用于当所述第一鉴权值与所述第二鉴权值不匹配时,所述服务器使视频流地址鉴权不通过所述客户端。
  9. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现以下步骤:
    获取用于鉴权的第一信息;
    基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
    发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
  10. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理 器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现以下步骤:
    获取用于鉴权的第一信息;
    基于所述第一信息和预先接收的LUA脚本,获得第一鉴权值,其中,所述LUA脚本是由服务器预先发送给客户端的,所述LUA脚本中预先包括视频流地址的加密算法的代码;
    发送所述第一信息和所述第一鉴权值至服务器,以供所述服务器通过所述加密算法和所述第一信息确定出第二鉴权值,并判断所述第一鉴权值与所述第二鉴权值是否匹配,其中,当所述第一鉴权值与所述第二鉴权值匹配时,客户端通过视频流地址鉴权。
PCT/CN2018/082500 2017-06-30 2018-04-10 一种视频流地址的鉴权方法及装置 WO2019001082A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710524148.9A CN107483987B (zh) 2017-06-30 2017-06-30 一种视频流地址的鉴权方法及装置
CN201710524148.9 2017-06-30

Publications (1)

Publication Number Publication Date
WO2019001082A1 true WO2019001082A1 (zh) 2019-01-03

Family

ID=60596334

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/082500 WO2019001082A1 (zh) 2017-06-30 2018-04-10 一种视频流地址的鉴权方法及装置

Country Status (2)

Country Link
CN (1) CN107483987B (zh)
WO (1) WO2019001082A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021234453A1 (en) 2020-05-20 2021-11-25 Aummune Ltd. Bispecific personalized aptamers

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483987B (zh) * 2017-06-30 2020-02-07 武汉斗鱼网络科技有限公司 一种视频流地址的鉴权方法及装置
CN108235067B (zh) * 2018-01-04 2020-09-08 武汉斗鱼网络科技有限公司 一种视频流地址的鉴权方法及装置
CN110011950B (zh) * 2018-01-04 2021-11-09 武汉斗鱼网络科技有限公司 一种视频流地址的鉴权方法及装置
CN108307211B (zh) * 2018-01-05 2020-02-07 武汉斗鱼网络科技有限公司 一种视频流地址鉴权方法、存储介质、设备及系统
CN108966043A (zh) * 2018-08-08 2018-12-07 福州智永信息科技有限公司 一种视频一致性鉴权方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719210A (zh) * 2009-12-25 2010-06-02 武汉大学 基于linux平台数字版权管理的文件使用控制方法
CN101834867A (zh) * 2010-05-07 2010-09-15 杭州华三通信技术有限公司 一种客户端安全保护方法及其装置
US20120117041A1 (en) * 2010-11-08 2012-05-10 Verisign, Inc. Debugging a stored procedure in a database
CN105721411A (zh) * 2015-05-15 2016-06-29 乐视云计算有限公司 一种防止盗链的方法、防止盗链的服务器及客户端
CN105959728A (zh) * 2016-06-27 2016-09-21 武汉斗鱼网络科技有限公司 统计直播平台在线人数的系统及其方法
CN107483987A (zh) * 2017-06-30 2017-12-15 武汉斗鱼网络科技有限公司 一种视频流地址的鉴权方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719210A (zh) * 2009-12-25 2010-06-02 武汉大学 基于linux平台数字版权管理的文件使用控制方法
CN101834867A (zh) * 2010-05-07 2010-09-15 杭州华三通信技术有限公司 一种客户端安全保护方法及其装置
US20120117041A1 (en) * 2010-11-08 2012-05-10 Verisign, Inc. Debugging a stored procedure in a database
CN105721411A (zh) * 2015-05-15 2016-06-29 乐视云计算有限公司 一种防止盗链的方法、防止盗链的服务器及客户端
CN105959728A (zh) * 2016-06-27 2016-09-21 武汉斗鱼网络科技有限公司 统计直播平台在线人数的系统及其方法
CN107483987A (zh) * 2017-06-30 2017-12-15 武汉斗鱼网络科技有限公司 一种视频流地址的鉴权方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021234453A1 (en) 2020-05-20 2021-11-25 Aummune Ltd. Bispecific personalized aptamers

Also Published As

Publication number Publication date
CN107483987A (zh) 2017-12-15
CN107483987B (zh) 2020-02-07

Similar Documents

Publication Publication Date Title
WO2019001082A1 (zh) 一种视频流地址的鉴权方法及装置
US10135828B2 (en) Technologies for secure server access using a trusted license agent
CN108923908B (zh) 授权处理方法、装置、设备及存储介质
US20180367528A1 (en) Seamless Provision of Authentication Credential Data to Cloud-Based Assets on Demand
US10135824B2 (en) Method and system for determining whether a terminal logging into a website is a mobile terminal
US9003519B2 (en) Verifying transactions using out-of-band devices
CN107483509A (zh) 一种身份验证方法、服务器及可读存储介质
US20150249617A1 (en) Enrolling a mobile device with an enterprise mobile device management environment
TWI682297B (zh) 防止跨網站請求偽造的方法、裝置及系統
CN110784433A (zh) 一种用户访问处理方法、装置及设备
EP3453136A1 (en) Methods and apparatus for device authentication and secure data exchange between a server application and a device
US10333925B2 (en) Seamless provision of authentication credential data to cloud-based assets on demand
US20120210436A1 (en) System and method for fingerprinting in a cloud-computing environment
CN110011950B (zh) 一种视频流地址的鉴权方法及装置
US10862880B1 (en) Authentication security via application-specific dynamic token generation
CN109286620B (zh) 用户权限管理方法、系统、设备和计算机可读存储介质
CN108289074B (zh) 用户账号登录方法及装置
CN111538977A (zh) 云api密钥的管理、云平台的访问方法、装置及服务器
US20160364565A1 (en) Authentication and secure communication with application extensions
US11153099B2 (en) Reestablishing secure communication with a server after the server's certificate is renewed with a certificate authority unknown to the client
WO2019001084A1 (zh) 一种视频流地址鉴权方法及装置
CN113678131A (zh) 使用区块链保护在线应用程序和网页
CN108235067B (zh) 一种视频流地址的鉴权方法及装置
US11669626B2 (en) Resource access with use of bloom filters
CN116996305A (zh) 一种多层次安全认证方法、系统、设备、存储介质及入口网关

Legal Events

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

Ref document number: 18822757

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: 18822757

Country of ref document: EP

Kind code of ref document: A1