【发布时间】:2020-10-15 13:45:10
【问题描述】:
我在加密和解密我的视频文件以及加密视频文件时遇到问题。没有任何错误。但它在加密和解密视频文件时卡住了。我使用异步方法。但它仍然卡住。下面是我的代码。
加密:
Future sifrele() async {
try {
crypt.setOverwriteMode(AesCryptOwMode.on);
encFilepath = await crypt.encryptFile(realPath + '/WhatCarCanYouGetForAGrand.mp4', realPath + '/video.mp4.aes');
print('The encryption has been completed successfully.');
} on AesCryptException catch (e) {
if (e.type == AesCryptExceptionType.destFileExists) {
print('The encryption has been completed unsuccessfully.');
}
return;
}
}
解密:
Future decrypting() async {
var videos = File(realPath + "/ElephantsDream.mp4.aes");
try {
realPath = await crypt.decryptFile(realPath + '/video.mp4.aes', realPath + '/cozulen.mp4');
print('The decryption has been completed successfully.');
} on AesCryptException catch (e) {
if (e.type == AesCryptExceptionType.destFileExists) {
print('The decryption has been completed unsuccessfully.');
}
return;
}
}
谢谢。
【问题讨论】:
标签: flutter encryption crypt