5. 自定义格式-PHP Tutorial-php.cn">

Home  >  Article  >  Backend Development  >  5. 自定义格式

5. 自定义格式

WBOY
WBOYOriginal
2016-06-13 12:28:581130browse

Atitit.视频文件加密的方法大的总结 java c# php

Atitit.视频文件加密的方法大的总结 java c# php

 

 

1加密的算法  aes  3des  des xor.1

2性能1

3解密1

4播放器的事件扩展1

5自定义格式1

 

1. 加密的算法  aes  3des  des xor.

Aes安全性最好...

 

2. 性能

可以只加密文件头走行兰..

 

3. 解密

文件解密    内存解密...

 

可以播放以前解密...播放over再加密...

 

 

作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:[email protected]

转载请注明来源: http://www.cnblogs.com/attilax/

 

4. 播放器的事件扩展

Before_play_ready_event

Play_finish_and_unclock_file_occu_event

5. 自定义格式

自定义格式麻烦的...

 

 

package aaa;

 

import java.io.FileNotFoundException;

import java.io.RandomAccessFile;

 

import com.attilax.exception.ExUtil;

 

public class Encry {

 

public static void main(String[] args) {

String f = "C:\\00\\m2.mp4"

//f = "C:\\00\\a.txt";

 

encry(f);

System.out.println("--f");

}

 

private static void encry(String f) {

 

RandomAccessFile raf;

try {

raf = new RandomAccessFile(f"rws");

for (int i = 0; i i++) { // 加密前五个字节

 

raf.seek(i);

int byte_cur = raf.read();   //if read seek auto next

int byte_new = byte_cur ^ 123;

raf.seek(i);

raf.write(byte_new);// 写入与123异或的值.

}

raf.close();

catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

ExUtil.throwEx(e);

}

 

}

 

}

 

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn