在我的Windows Mobile應用程序(v.6.x)中,我正在將媒體文件下載到設備上。是否有加密此內容的路徑?爲了使媒體文件能夠被應用程序解密,例如每隔100個字節進行一次混洗Windows Mobile內容加密
0
A
回答
1
可能是這樣的工作嗎?
private Byte[] CryptoKey
{
get { return new Byte[] { 0x0E, 0x41, 0x6A, 0x29, 0x94, 0x12, 0xEB, 0x63 }; }
}
public Byte[] Encrypt(Byte[] bytes)
{
using (var crypto = new DESCryptoServiceProvider())
{
var key = CryptoKey;
using (var encryptor = crypto.CreateEncryptor(key, key))
{
return encryptor.TransformFinalBlock(bytes, 0, bytes.Length);
}
}
}
public Byte[] Decrypt(Byte[] bytes)
{
using (var crypto = new DESCryptoServiceProvider())
{
var key = CryptoKey;
using (var decryptor = crypto.CreateDecryptor(key, key))
{
return decryptor.TransformFinalBlock(bytes, 0, bytes.Length);
}
}
}
+0
是的,就是這樣。在我過去的C講座的筆記中發現。不過,我會鼓勵使用「TransformFinalBlock」 – leviathan 2012-06-29 08:04:12
1
您可以看看Compact Framework中的Cryptography命名空間,該命名空間有幾個用於加密和解密數據的類,例如提供AES加密的RijndaelManaged類。
在MSDN上的RijndaelManaged頁面的示例中,您可以看到有關如何加密和解密文件內容的示例。您應該可以對媒體文件使用相同的技巧。
相關問題
- 1. API密鑰內容加密
- 2. 異步加載內容在Windows Mobile 6.5中的C#
- 3. 加密註冊表內容
- 4. 加密數據庫內容
- 5. jQuery mobile僅加載正文內容
- 6. jquery mobile - 將內容加載到div中
- 7. STL容器支持Windows Mobile
- 8. 加密和解密xml文件內容
- 9. Mac和Windows的自動加載內容的USB密鑰?
- 10. iOS和Windows Phone兼容加密
- 11. JQuery-Mobile多內容角色
- 12. JQuery Mobile內容高度:100%
- 13. JQuery Mobile可摺疊內容
- 14. jquery mobile顯示html內容
- 15. Windows Mobile加速計API 6
- 16. 如何查看加密文件的內容?[hadoop透明加密]
- 17. git blob的內容是否被加密?
- 18. 上傳時加密文件的內容
- 19. Android - 加密/保護SD卡內容
- 20. 檢查加密文件的空內容
- 21. 通緝兼容AES代碼Iphone,Android,Windows/XP加密/解密
- 22. Windows Mobile 6版本兼容性
- 23. 內容添加在Windows 8 groupeditemspage
- 24. 科爾多瓦爲Windows Mobile 8.1構建與Windows Mobile 10不兼容
- 25. 加密Web.config Windows Azure
- 26. 如何增加Windows Mobile上的進程的可用內存?
- 27. Windows Mobile 5上的內存不足
- 28. 內存不足.NETCF Windows Mobile 5
- 29. 如何使用OpenSSL加密的PyCrypto解密某些內容?
- 30. 如何使用Qt加密/解密文件內容?
請問您可以添加一些標籤,如「加密」,「解密」,「密碼學」等? – 2010-01-29 09:59:41
到目前爲止的建議有什麼問題? – 2010-02-01 14:13:36