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
30
+
constRSA_MAX_SIZE=190;// the max size in bytes for RSA-2048 with OAEP padding
23
31
24
32
consthandleEncrypt=async()=>{
25
33
if(!file||(!key&&method!=="rsa")){
26
34
setMessage({text: "Please select a file and enter a key (except RSA).",type: "error"});
27
35
return;
28
36
}
29
37
30
-
// Check file size for RSA
38
+
// check file size for RSA
31
39
if(method==="rsa"&&file.size>RSA_MAX_SIZE){
32
40
setMessage({
33
41
text: `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.`,
@@ -36,7 +44,7 @@ export default function EncryptPage() {
36
44
return;
37
45
}
38
46
39
-
// Check key length for 3DES
47
+
// check key length for 3DES
40
48
if(method==="3des"&&key.length<16){
41
49
setMessage({
42
50
text: `3DES key must be at least 16 characters long. Your key is ${key.length} characters.`,
@@ -51,7 +59,7 @@ export default function EncryptPage() {
51
59
formData.append("method",method);
52
60
formData.append("key",key);
53
61
54
-
// Add AES-specific parameters
62
+
// add AES params
55
63
if(method==="aes"){
56
64
formData.append("key_size",parseInt(aesKeySize));
57
65
formData.append("block_mode",aesMode);
@@ -70,7 +78,6 @@ export default function EncryptPage() {
70
78
constblob=awaitresponse.blob();
71
79
consturl=window.URL.createObjectURL(blob);
72
80
73
-
// Get filename from Content-Disposition header or create one from original
0 commit comments