CN105357206A - 一种视频安全传输方法 - Google Patents

一种视频安全传输方法 Download PDF

Info

Publication number
CN105357206A
CN105357206A CN201510801624.8A CN201510801624A CN105357206A CN 105357206 A CN105357206 A CN 105357206A CN 201510801624 A CN201510801624 A CN 201510801624A CN 105357206 A CN105357206 A CN 105357206A
Authority
CN
China
Prior art keywords
mapping table
encryption
map
deciphering
video
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201510801624.8A
Other languages
English (en)
Inventor
夏俊
刘方全
赵云锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Ming Shitang Education And Science Development Co Ltd
Original Assignee
Hangzhou Ming Shitang Education And Science Development Co Ltd
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 Hangzhou Ming Shitang Education And Science Development Co Ltd filed Critical Hangzhou Ming Shitang Education And Science Development Co Ltd
Priority to CN201510801624.8A priority Critical patent/CN105357206A/zh
Publication of CN105357206A publication Critical patent/CN105357206A/zh
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0457Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply dynamic encryption, e.g. stream encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本发明公开了一种视频安全传输方法,首先修改flv视频文件头部,将原有的保留字段改为加密指示字段IsEncrypt,同时修改DataOffset字段的值,在原来的值的基础上加上解密映射表长度256。在DataOffset后加入视频加密映射表和音频加密映射表。然后生成视频加密解密映射表map,根据得到的map映射表,对VideoHashTable表后的数据进行加密;将解密映射表放入DataOffset字段之后,加密完成;输到客户端;在播放flv文件时,先判断是否加密,如加密,则根据解密映射表对解密映射表后的数据进行解密。本发明修改了原有头部使之能兼容加密和不加密两种模式。将解密映射表放入头部,这样可以实现只需要一个文件就能解密。加密算法采用随机的hash表,同一个数据加密后在不同文件中是不一样的,加大了破解难度。

Description

一种视频安全传输方法
技术领域
本发明属于视频传输技术领域,尤其涉及一种视频安全传输方法。
背景技术
在在线教育行业,如何对自己制作各种教学视频进行安全的在线传输,防止非法copy,下载传播,一直是一个难题。目前市场上的解决方案,都是传输前对视频进行加密,然后在播放时解密。这些方案要么会显著增加视频的文件大小,会增加对服务器存储资源的消耗和传输带宽的消耗,要么加密解密过程过于复杂,计算量大。增加客户端如智能手机cpu的运算量,引起视频卡顿和加剧电池电量的消耗。总之,就是解决方案不够灵活而且成本较高。
发明内容
本发明的目的在于针对现有技术的不足,提供一种视频安全传输方法。
本发明的目的是通过以下技术方案来实现的:一种视频安全传输方法,该方法包括以下步骤:
(1)修改flv视频文件头部,将原有的保留字段改为加密指示字段IsEncrypt,定义这个字段等于9时表示采用了本方法加密,不为9则没有采用本方法加密。同时修改DataOffset字段的值,在原来的值的基础上加上解密映射表长度256。在DataOffset后加入视频加密映射表和音频加密映射表。
(2)生成视频加密解密映射表map[0..255],map[i]=random(i)%(256–i),具体包括以下子步骤:
(2.1)依次随机地在0到255中取一个数a1,令map[0]=a1;
(2.2)除掉a1,剩下的255个数中随机取出一个数a2,令map[1]=a2;
(2.3)重复上述步骤,在256-i个数中取出一个数ai令map[i]=ai;直到256个数都被取出放入map中;
(2.4)遍历map数组,使unmap[map[i]]=i,0≤i<256,得到解密映射表unmap[0..255],此表即放入头部中的解密映射表VideoHashTable。
(3)根据得到的map映射表,对VideoHashTable表后的数据进行加密,加密前数据为a,加密后数据为map[a]。
(4)将解密映射表放入DataOffset字段之后,加密完成。
(5)通过http或者其他协议将文件传输到客户端。
(6)修改播放器,在播放flv文件时,先检测IsEncrypt之段,判断其是否为9,若不为9,则没有加密直接播放,否则进入下一步。
(7)取得flv文件中的解密映射表unmap[0..255],对解密映射表后的数据进行解密,如解密前的数据为a,解密的数变为unmap[a],完成解密。
(8)播放器播放解密后的文件。
(9)播放器完成播放。
本发明的有益效果是:本发明修改了原有头部(flvheader)使之能兼容加密和不加密两种模式。将解密映射表放入头部,这样可以实现只需要一个文件就能解密。加密算法采用随机的hash表,同一个数据加密后在不同文件中是不一样的,加大了破解难度。
具体实施方式
下面通过具体实施例对本发明作进一步详细说明。
本发明一种视频安全传输方法,该方法包括以下步骤:
(1)修改flv视频文件头部,使之能兼容加密和不加密两种模式,flv视频文件原始的头部如下:
TheFLVheader
Field Type Comment
Signature UI8 Signature byte always'F'(0x46)
Signature UI8 Signature byte always'L'(0x4C)
Signature UI8 Signature byte always'V'(0x56)
Version UI8 File version(for example,0x01for FLV version 1)
TypeFlagsReserved UB[5] Shall be 0
TypeFlagsAudio UB[1] 1=Audio tags are present
TypeFlagsReserved UB[1] Shall be 0
TypeFlagsVideo UB[1] 1=Video tags are present
DataOffset UI32 The length of this header in bytes
修改为:
Field Type Comment
Signature UI8 Signature byte always'F'(0x46)
Signature UI8 Signature byte always'L'(0x4C)
Signature UI8 Signature byte always'V'(0x56)
Version UI8 File version(for example,0x01for FLV version 1)
IsEncrypt UB[5] 9:为使用了加密,其他为没使用加密
TypeFlagsAudio UB[1] 1=Audio tags are present
TypeFlagsReserved UB[1] Shall be 0
TypeFlagsVideo UB[1] 1=Video tags are present
DataOffset UI32 视频头部的长度加上解密映射表长度256
VideoHashTable U 255 255个字节的视频解密映射表
即将原有的保留字段改为加密指示字段IsEncrypt,定义这个字段等于9时表示采用了本方法加密,不为9则没有采用本方法加密。同时修改DataOffset字段的值,在原来的值的基础上加上解密映射表长度256。在DataOffset后加入视频加密映射表和音频加密映射表。
(2)生成视频加密解密映射表map[0..255],map[i]=random(i)%(256–i),具体包括以下子步骤:
(2.1)依次随机地在0到255中取一个数a1,令map[0]=a1;
(2.2)除掉a1,剩下的255个数中随机取出一个数a2,令map[1]=a2;
(2.3)重复上述步骤,在256-i个数中取出一个数ai令map[i]=ai;直到256个数都被取出放入map中;
(2.4)遍历map数组,使unmap[map[i]]=i,0≤i<256,得到解密映射表unmap[0..255],此表即放入头部中的解密映射表VideoHashTable。
(3)根据得到的map映射表,对VideoHashTable表后的数据进行加密,加密前数据为a,加密后数据为map[a]。
(4)将解密映射表放入DataOffset字段之后,加密完成。
(5)通过http或者其他协议将文件传输到客户端。
(6)修改播放器,在播放flv文件时,先检测IsEncrypt之段,判断其是否为9,若不为9,则没有加密直接播放,否则进入下一步。
(7)取得flv文件中的解密映射表unmap[0..255],对解密映射表后的数据进行解密,如解密前的数据为a,解密的数变为unmap[a],完成解密。
(8)播放器播放解密后的文件。
(9)播放器完成播放。

Claims (1)

1.一种视频安全传输方法,其特征在于,该方法包括以下步骤:
(1)修改flv视频文件头部,将原有的保留字段改为加密指示字段IsEncrypt,定义这个字段等于9时表示采用了本方法加密,不为9则没有采用本方法加密。同时修改DataOffset字段的值,在原来的值的基础上加上解密映射表长度256。在DataOffset后加入视频加密映射表和音频加密映射表。
(2)生成视频加密解密映射表map[0..255],map[i]=random(i)%(256–i),具体包括以下子步骤:
(2.1)依次随机地在0到255中取一个数a1,令map[0]=a1;
(2.2)除掉a1,剩下的255个数中随机取出一个数a2,令map[1]=a2;
(2.3)重复上述步骤,在256-i个数中取出一个数ai令map[i]=ai;直到256个数都被取出放入map中;
(2.4)遍历map数组,使unmap[map[i]]=i,0≤i<256,得到解密映射表unmap[0..255],此表即放入头部中的解密映射表VideoHashTable。
(3)根据得到的map映射表,对VideoHashTable表后的数据进行加密,加密前数据为a,加密后数据为map[a]。
(4)将解密映射表放入DataOffset字段之后,加密完成。
(5)通过http或者其他协议将文件传输到客户端。
(6)修改播放器,在播放flv文件时,先检测IsEncrypt之段,判断其是否为9,若不为9,则没有加密直接播放,否则进入下一步。
(7)取得flv文件中的解密映射表unmap[0..255],对解密映射表后的数据进行解密。
(8)播放器播放解密后的文件。
(9)播放器完成播放。
CN201510801624.8A 2015-11-19 2015-11-19 一种视频安全传输方法 Pending CN105357206A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510801624.8A CN105357206A (zh) 2015-11-19 2015-11-19 一种视频安全传输方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510801624.8A CN105357206A (zh) 2015-11-19 2015-11-19 一种视频安全传输方法

Publications (1)

Publication Number Publication Date
CN105357206A true CN105357206A (zh) 2016-02-24

Family

ID=55333070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510801624.8A Pending CN105357206A (zh) 2015-11-19 2015-11-19 一种视频安全传输方法

Country Status (1)

Country Link
CN (1) CN105357206A (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106228082A (zh) * 2016-07-18 2016-12-14 武汉斗鱼网络科技有限公司 Swf文件的保护方法及系统
CN108600196A (zh) * 2018-04-04 2018-09-28 广东中星电子有限公司 图像的加密方法和装置以及解密方法和装置
CN111200741A (zh) * 2020-04-02 2020-05-26 上海商魁信息科技有限公司 一种视频处理方法、装置和机器可读存储介质
CN111314742A (zh) * 2020-04-02 2020-06-19 上海商魁信息科技有限公司 一种视频处理方法、装置和机器可读存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060251246A1 (en) * 2003-03-07 2006-11-09 Yoshinori Matsui Encryption device, decryption device, and data reproduction device
US20110129087A1 (en) * 2009-11-30 2011-06-02 General Instrument Corporation System and Method for Encrypting and Decrypting Data
CN102334124A (zh) * 2011-08-15 2012-01-25 华为终端有限公司 文件的保护方法及装置
US20120114118A1 (en) * 2010-11-05 2012-05-10 Samsung Electronics Co., Ltd. Key rotation in live adaptive streaming
CN102469345A (zh) * 2010-11-19 2012-05-23 康佳集团股份有限公司 多媒体媒体数据加解密方法
CN102567690A (zh) * 2011-12-27 2012-07-11 四川长虹电器股份有限公司 一种对flv文件进行加密的方法
CN102904712A (zh) * 2011-07-25 2013-01-30 深圳市金溢科技有限公司 信息加密方法
CN102917250A (zh) * 2012-11-08 2013-02-06 四川虹微技术有限公司 用于数字媒体接口的音视频传输方法
US20130129085A1 (en) * 2011-05-27 2013-05-23 Viswanathan Swaminathan System And Method For Decryption Of Content Including Partial-Block Discard

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060251246A1 (en) * 2003-03-07 2006-11-09 Yoshinori Matsui Encryption device, decryption device, and data reproduction device
US20110129087A1 (en) * 2009-11-30 2011-06-02 General Instrument Corporation System and Method for Encrypting and Decrypting Data
US20120114118A1 (en) * 2010-11-05 2012-05-10 Samsung Electronics Co., Ltd. Key rotation in live adaptive streaming
CN102469345A (zh) * 2010-11-19 2012-05-23 康佳集团股份有限公司 多媒体媒体数据加解密方法
US20130129085A1 (en) * 2011-05-27 2013-05-23 Viswanathan Swaminathan System And Method For Decryption Of Content Including Partial-Block Discard
CN102904712A (zh) * 2011-07-25 2013-01-30 深圳市金溢科技有限公司 信息加密方法
CN102334124A (zh) * 2011-08-15 2012-01-25 华为终端有限公司 文件的保护方法及装置
CN102567690A (zh) * 2011-12-27 2012-07-11 四川长虹电器股份有限公司 一种对flv文件进行加密的方法
CN102917250A (zh) * 2012-11-08 2013-02-06 四川虹微技术有限公司 用于数字媒体接口的音视频传输方法

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106228082A (zh) * 2016-07-18 2016-12-14 武汉斗鱼网络科技有限公司 Swf文件的保护方法及系统
CN106228082B (zh) * 2016-07-18 2019-01-29 武汉斗鱼网络科技有限公司 Swf文件的保护方法及系统
CN108600196A (zh) * 2018-04-04 2018-09-28 广东中星电子有限公司 图像的加密方法和装置以及解密方法和装置
CN111200741A (zh) * 2020-04-02 2020-05-26 上海商魁信息科技有限公司 一种视频处理方法、装置和机器可读存储介质
CN111314742A (zh) * 2020-04-02 2020-06-19 上海商魁信息科技有限公司 一种视频处理方法、装置和机器可读存储介质
CN111200741B (zh) * 2020-04-02 2022-04-15 上海商魁信息科技有限公司 一种视频处理方法、装置和机器可读存储介质

Similar Documents

Publication Publication Date Title
EP3346633B1 (en) Permission information management system, user terminal, proprietor terminal, permission information management method, and permission information management program
CN103366102B (zh) 用于内容传输和分配的数字版权管理系统
CN101271501B (zh) 数字媒体文件的加解密方法及装置
CN103841469B (zh) 一种数字电影版权保护方法和装置
US8712041B2 (en) Content protection apparatus and content encryption and decryption apparatus using white-box encryption table
KR101324825B1 (ko) 메시지 인증 코드 사전 연산 방법 및 시스템
US8700897B2 (en) Method and terminal equipment for applying digital rights management
CN103400064B (zh) 用于文件加密和解密的方法和设备
JP2005110248A5 (zh)
CN105357206A (zh) 一种视频安全传输方法
CN103401678A (zh) 一种保障物联网数据传输安全的方法
CN103488915B (zh) 一种软硬件相结合的双重密钥加密的资源加密解密方法
WO2019152201A1 (en) Secure crypto system attributes
CN103595698B (zh) 一种数字权益管理方法
CN101610148B (zh) 一种对等互联网络数字版权保护方法
CN106534176A (zh) 一种云环境下数据安全存储方法
CN102063598A (zh) 一种数据加密、解密方法及装置
CN113312608B (zh) 一种基于时间戳的电力计量终端身份认证方法及系统
JP2010541299A5 (zh)
CN102693386A (zh) 一种影视文件加密保护的方法和系统
CN104009839A (zh) 一种携带用户信息的密钥的生成方法
ES2897685T3 (es) Método y sistema de acceso condicional a un contenido digital, terminal y dispositivo de suscriptor asociados
CN108431819A (zh) 保护客户端访问视频播放器的drm代理的服务的方法和系统
CN104993924A (zh) 一种数字版权加解密方法
CN102510374B (zh) 一种前端系统可检测克隆的许可证管理方法和装置

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160224