You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constRSA_MAX_SIZE=190;// Maximum size in bytes for RSA-2048 with OAEP padding
20
+
19
21
consthandleEncrypt=async()=>{
20
22
if(!file||(!key&&method!=="rsa")){
21
23
alert("Please select a file and enter a key (except RSA).");
22
24
return;
23
25
}
24
26
27
+
// Check file size for RSA
28
+
if(method==="rsa"&&file.size>RSA_MAX_SIZE){
29
+
alert(`RSA encryption is limited to files smaller than ${RSA_MAX_SIZE} bytes. Your file is ${file.size} bytes. Please use AES or 3DES for larger files.`);
30
+
return;
31
+
}
32
+
25
33
setLoading(true);
26
34
constformData=newFormData();
27
35
formData.append("file",file);
@@ -92,11 +100,26 @@ export default function EncryptPage() {
0 commit comments