I have a problem encrypting and decrypting my video file and it encrypting video file. there is no any error. but it stucks while is encrypting and decrypting video files. I use asynchronous method. but it still stucks. my code below.
encrypt:
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;
}
}
decrypt:
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;
}
}
thanks.