diff --git a/Bark/en.lproj/Localizable.strings b/Bark/en.lproj/Localizable.strings index 0c1f5fe1..0f8ffae2 100644 --- a/Bark/en.lproj/Localizable.strings +++ b/Bark/en.lproj/Localizable.strings @@ -148,6 +148,7 @@ ivComment = "IV can be randomly generated, but if it is random, it needs to be p opensslEncodingComment = "openssl requires Hex encoding of manual keys and IVs, not ASCII encoding."; ciphertextComment = "URL encoding the ciphertext, there may be special characters."; consoleComment = "The console will print"; +base64Notice = "If you get a 'Decryption Failed' prompt, try adding '-w 0' after the base64 command."; keyComment = "Must be %d bit long"; removeMessage = "Remove"; diff --git a/Bark/tr.lproj/Localizable.strings b/Bark/tr.lproj/Localizable.strings index 1e513b1d..309b6660 100644 --- a/Bark/tr.lproj/Localizable.strings +++ b/Bark/tr.lproj/Localizable.strings @@ -148,6 +148,7 @@ ivComment = "IV rastgele oluşturulabilir, ancak rastgele ise iv parametresinde opensslEncodingComment = "openssl, manuel anahtarların ve IV'lerin ASCII kodlamasını değil, Hex kodlamasını gerektirir."; ciphertextComment = "URL şifreli metni kodlarken özel karakterler olabilir."; consoleComment = "Konsola şunları yazdırır"; +base64Notice = "If you get a 'Decryption Failed' prompt, try adding '-w 0' after the base64 command."; keyComment = "%d bit uzunluğunda olmalıdır"; removeMessage = "Sil"; diff --git a/Bark/zh-Hans.lproj/Localizable.strings b/Bark/zh-Hans.lproj/Localizable.strings index 5c880fbc..b8416fd2 100644 --- a/Bark/zh-Hans.lproj/Localizable.strings +++ b/Bark/zh-Hans.lproj/Localizable.strings @@ -148,6 +148,7 @@ ivComment = "IV可以是随机生成的,但如果是随机的就需要放在 i opensslEncodingComment = "OpenSSL 要求输入的 Key 和 IV 需使用十六进制编码。"; ciphertextComment = "密文可能有特殊字符,所以记得 URL 编码一下。"; consoleComment = "控制台将打印"; +base64Notice = "如果提示 Decryption Failed, 尝试在 base64 命令后面 加上 -w 0"; keyComment = "必须%d位"; removeMessage = "删除"; diff --git a/Controller/CryptoSettingViewModel.swift b/Controller/CryptoSettingViewModel.swift index 1092c5af..7f312c8a 100644 --- a/Controller/CryptoSettingViewModel.swift +++ b/Controller/CryptoSettingViewModel.swift @@ -121,8 +121,9 @@ class CryptoSettingViewModel: ViewModel, ViewModelType { # \(NSLocalizedString("opensslEncodingComment")) key=$(printf $key | xxd -ps -c 200) iv=$(printf $iv | xxd -ps -c 200) - - ciphertext=$(echo -n $json | openssl enc -aes-\(fields.algorithm.suffix(3))-\(fields.mode.lowercased()) -K $key \(iv.count > 0 ? "-iv $iv " : "")| base64 -w 0) + + # \(NSLocalizedString("base64Notice")) + ciphertext=$(echo -n $json | openssl enc -aes-\(fields.algorithm.suffix(3))-\(fields.mode.lowercased()) -K $key \(iv.count > 0 ? "-iv $iv " : "")| base64) # \(NSLocalizedString("consoleComment")) "\((try? AESCryptoModel(cryptoFields: fields).encrypt(text: "{\"body\": \"test\", \"sound\": \"birdsong\"}")) ?? "")" echo $ciphertext