摘要: public class DESHelper { //默认密钥向量 private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; /// <summary> /// DES加密字符串 /// </summary> /// <param name="encryptString">待加密的字符串</param> /// <param name="encryptKey">加密密钥,要求为8位</p 阅读全文
posted @ 2012-10-24 15:23 Sky Wang 阅读(365) 评论(0) 推荐(0) 编辑
摘要: /// 将 Stream 转成 byte[] public byte[] StreamToBytes(Stream stream) { byte[] bytes = new byte[stream.Length]; stream.Read(bytes, 0, bytes.Length); // 设置当前流的位置为流的开始 stream.Seek(0, SeekOrigin.Begin); return bytes; } /// 将 byte[] 转成 Stream public Stream BytesToStre... 阅读全文
posted @ 2012-10-24 15:18 Sky Wang 阅读(1038) 评论(0) 推荐(0) 编辑