diff options
| author | Aizistral | 2026-11-18 15:19:44 +0100 |
|---|---|---|
| committer | Aizistral | 2026-11-18 15:19:44 +0100 |
| commit | 1cc3dff4afb44d3c01fb940ae443c4842807ece6 (patch) | |
| tree | 393e0308fe16dde031cc4a8e6c55fcc038e1125a | |
| parent | d1f371259a10670577a5c93d29f86d2a7b25f84b (diff) | |
Discontinue chat encryption support
39 files changed, 13 insertions, 1868 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/common/NCRClient.java b/src/main/java/com/aizistral/nochatreports/common/NCRClient.java index 524cfe0..7f5d177 100644 --- a/src/main/java/com/aizistral/nochatreports/common/NCRClient.java +++ b/src/main/java/com/aizistral/nochatreports/common/NCRClient.java @@ -92,7 +92,7 @@ public class NCRClient { chatScr.init(mc, mc.getWindow().getGuiScaledWidth(), mc.getWindow().getGuiScaledHeight()); } - chatScr.handleChatInput(NCRConfig.getEncryption().getLastMessage(), false); + chatScr.handleChatInput(ServerSafetyState.getLastMessage(), false); } } diff --git a/src/main/java/com/aizistral/nochatreports/common/config/ModMenuIntegration.java b/src/main/java/com/aizistral/nochatreports/common/config/ModMenuIntegration.java index 5546ff3..d34e03d 100644 --- a/src/main/java/com/aizistral/nochatreports/common/config/ModMenuIntegration.java +++ b/src/main/java/com/aizistral/nochatreports/common/config/ModMenuIntegration.java @@ -143,24 +143,6 @@ public final class ModMenuIntegration implements ModMenuApi { .setSaveConsumer(newValue -> NCRConfig.getClient().verifiedIconOffsetY = newValue) .build()); - // Warning for showEncryptionButton - client.addEntry(entryBuilder.startTextDescription(Component.translatable("gui.NoChatReports.showEncryptionButtonWarning")) - .build()); - - // Set an option for showEncryptionButton - client.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.showEncryptionButton"), NCRConfig.getEncryption().showEncryptionButton) - .setDefaultValue(true) - .setTooltip(this.makeTooltip("option.NoChatReports.showEncryptionButton.tooltip")) - .setSaveConsumer(newValue -> NCRConfig.getEncryption().showEncryptionButton = newValue) - .build()); - - // Set an option for showEncryptionIndicators - client.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.showEncryptionIndicators"), NCRConfig.getEncryption().showEncryptionIndicators) - .setDefaultValue(true) - .setTooltip(this.makeTooltip("option.NoChatReports.showEncryptionIndicators.tooltip")) - .setSaveConsumer(newValue -> NCRConfig.getEncryption().showEncryptionIndicators = newValue) - .build()); - // Set an option for showServerSafety client.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.showServerSafety"), NCRConfig.getClient().showServerSafety) .setDefaultValue(true) diff --git a/src/main/java/com/aizistral/nochatreports/common/config/NCRConfig.java b/src/main/java/com/aizistral/nochatreports/common/config/NCRConfig.java index 01c33fa..55098f2 100644 --- a/src/main/java/com/aizistral/nochatreports/common/config/NCRConfig.java +++ b/src/main/java/com/aizistral/nochatreports/common/config/NCRConfig.java @@ -14,7 +14,6 @@ public final class NCRConfig { private static NCRConfigCommon common = null; private static NCRConfigClient client = null; private static NCRServerPreferences serverPreferences = null; - private static NCRConfigEncryption encryption = null; private NCRConfig() { throw new IllegalStateException("Can't touch this"); @@ -34,11 +33,6 @@ public final class NCRConfig { return checkLoaded(() -> serverPreferences); } - @Environment(EnvType.CLIENT) - public static NCRConfigEncryption getEncryption() { - return checkLoaded(() -> encryption); - } - private static <T extends JSONConfig> T checkLoaded(Supplier<T> config) { if (config.get() == null) { load(); @@ -53,7 +47,6 @@ public final class NCRConfig { if (NCRCore.getProvider().getEnvironment() == EnvType.CLIENT) { client = JSONConfig.loadConfig(NCRConfigClient.class, NCRConfigClient::new, NCRConfigClient.FILE_NAME); serverPreferences = JSONConfig.loadConfig(NCRServerPreferences.class, NCRServerPreferences::new, NCRServerPreferences.FILE_NAME); - encryption = JSONConfig.loadConfig(NCRConfigEncryption.class, NCRConfigEncryption::new, NCRConfigEncryption.FILE_NAME); } save(); @@ -65,7 +58,6 @@ public final class NCRConfig { if (NCRCore.getProvider().getEnvironment() == EnvType.CLIENT) { checkLoaded(() -> client).saveFile(); checkLoaded(() -> serverPreferences).saveFile(); - checkLoaded(() -> encryption).saveFile(); } Path readme = JSONConfig.CONFIG_DIR.resolve("NoChatReports/README.md"); diff --git a/src/main/java/com/aizistral/nochatreports/common/config/NCRConfigEncryption.java b/src/main/java/com/aizistral/nochatreports/common/config/NCRConfigEncryption.java deleted file mode 100644 index a876c91..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/config/NCRConfigEncryption.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.aizistral.nochatreports.common.config; - -import java.security.InvalidKeyException; -import java.util.List; -import java.util.Optional; - -import com.aizistral.nochatreports.common.encryption.Encryption; -import com.aizistral.nochatreports.common.encryption.Encryptor; - -public class NCRConfigEncryption extends JSONConfig { - protected static final String FILE_NAME = "NoChatReports/NCR-Encryption.json"; - protected boolean skipWarning = false, enableEncryption = false, encryptPublic = true, - showEncryptionButton = true, showEncryptionIndicators = true; - protected String encryptionKey = Encryption.AES_CFB8.getDefaultKey(), encryptionPassphrase = "", - algorithmName = Encryption.AES_CFB8.getName(); - protected List<String> encryptableCommands = List.of("msg:1", "w:1", "whisper:1", "tell:1", "r:0", "dm:1", - "me:0", "m:1", "t:1", "pm:1", "emsg:1", "epm:1", "etell:1", "ewhisper:1"); - private transient Encryption algorithm; - private transient boolean isValid = false; - private transient String lastMessage = "???"; - - protected NCRConfigEncryption() { - super(FILE_NAME); - } - - @Override - public NCRConfigEncryption getDefault() { - return new NCRConfigEncryption(); - } - - @Override - protected void uponLoad() { - this.algorithm = Encryption.getRegistered().stream().filter(e -> e.getName().equals(this.algorithmName)) - .findFirst().orElse(Encryption.AES_CFB8); - this.validate(); - } - - private void validate() { - this.isValid = this.algorithm.validateKey(this.encryptionKey); - } - - public void toggleEncryption() { - this.enableEncryption = !this.enableEncryption; - this.saveFile(); - } - - public void setAlgorithm(Encryption encryption) { - this.algorithm = encryption; - this.algorithmName = encryption.getName(); - this.validate(); - this.saveFile(); - } - - public void setEncryptionKey(String key) { - this.encryptionKey = key; - this.validate(); - this.saveFile(); - } - - public void setEncryptionPassphrase(String pass) { - this.encryptionPassphrase = pass; - this.saveFile(); - } - - public void setEncryptPublic(boolean encryptPublic) { - this.encryptPublic = encryptPublic; - this.saveFile(); - } - - public void disableWarning() { - this.skipWarning = true; - } - - public boolean isWarningDisabled() { - return this.skipWarning; - } - - public boolean isEnabled() { - return this.enableEncryption; - } - - public String getEncryptionKey() { - return this.encryptionKey; - } - - public String getEncryptionPassphrase() { - return this.encryptionPassphrase; - } - - public boolean isValid() { - return this.isValid; - } - - public boolean shouldEncryptPublic() { - return this.encryptPublic; - } - - public boolean showEncryptionIndicators() { - return this.showEncryptionIndicators; - } - - public boolean isEnabledAndValid() { - return this.isEnabled() && this.isValid(); - } - - public Encryption getAlgorithm() { - return this.algorithm; - } - - public boolean shouldEncrypt(String message) { - return this.isEnabledAndValid() && this.getEncryptionStartIndex(message) != -1; - } - - public boolean showEncryptionButton() { - return this.showEncryptionButton; - } - - public int getEncryptionStartIndex(String message) { - if (!message.startsWith("/")) - return this.encryptPublic ? 0 : -1; - else { - for (String rule : this.encryptableCommands) { - String[] splat = rule.split(":"); - - if (splat.length != 2) - throw new IllegalArgumentException("Invalid encryptable command definition: " + rule - + ", in file: " + FILE_NAME); - - String cmd = splat[0]; - String args = splat[1]; - int argnum = 0; - - try { - argnum = Integer.valueOf(args); - } catch (NumberFormatException ex) { - throw new IllegalArgumentException("Invalid encryptable command definition: " + rule - + ", in file: " + FILE_NAME); - } - - String prefix = "/(" + cmd + "|.*:" + cmd + ") .*"; - if (message.matches(prefix)) { - splat = message.split(" ", 2); - char[] array = splat[1].toCharArray(); - - for (int i = 0; i < array.length; i++) { - char ch = array[i]; - if (argnum > 0) { - if (ch == ' ') { - argnum--; - } - continue; - } else { - int index = i + splat[0].length() + 1; - return index < message.length() ? index : -1; - } - } - } else { - continue; - } - } - - return -1; - } - } - - public void setLastMessage(String lastMessage) { - this.lastMessage = lastMessage; - } - - public String getLastMessage() { - return this.lastMessage; - } - - /** - * @return Chat encryptor, if encryption is enabled and user specified valid key in config. - */ - - public Optional<Encryptor<?>> getEncryptor() { - if (!this.isEnabledAndValid()) - return Optional.empty(); - - try { - return Optional.of(this.algorithm.getProcessor(this.encryptionKey)); - } catch (InvalidKeyException ex) { - throw new RuntimeException(ex); // shouldn't happen due to prior validation - } - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/core/EncryptionUtil.java b/src/main/java/com/aizistral/nochatreports/common/core/EncryptionUtil.java deleted file mode 100644 index 842dc86..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/core/EncryptionUtil.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.aizistral.nochatreports.common.core; - -import java.util.Optional; - -import com.aizistral.nochatreports.common.config.NCRConfig; -import com.aizistral.nochatreports.common.encryption.Encryptor; - -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.ComponentContents; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.network.chat.contents.LiteralContents; -import net.minecraft.network.chat.contents.TranslatableContents; - -public class EncryptionUtil { - - public static Optional<Component> tryDecrypt(Component component) { - var optional = NCRConfig.getEncryption().getEncryptor(); - if (optional.isEmpty()) - return Optional.empty(); - - Encryptor<?> encryption = optional.get(); - Component copy = recreate(component); - ComponentContents contents = copy.getContents(); - - return Optional.ofNullable(tryDecrypt(copy, encryption) ? copy : null); - } - - public static boolean tryDecrypt(Component component, Encryptor<?> encryptor) { - boolean decryptedSiblings = false; - for (Component sibling : component.getSiblings()) { - if (tryDecrypt(sibling, encryptor)) { - decryptedSiblings = true; - } - } - - if (component.getContents() instanceof LiteralContents literal) { - var decrypted = tryDecrypt(literal.text(), encryptor); - - if (decrypted.isPresent()) { - ((MutableComponent)component).contents = new LiteralContents(decrypted.get()); - return true; - } - } else if (component.getContents() instanceof TranslatableContents translatable) { - for (Object arg : translatable.args) { - if (arg instanceof MutableComponent mutable) { - if (tryDecrypt(mutable, encryptor)) { - decryptedSiblings = true; - } - } - } - } - - return decryptedSiblings; - } - - public static Optional<String> tryDecrypt(String message, Encryptor<?> encryptor) { - try { - String[] splat = message.contains(" ") ? message.split(" ") : new String[] { message }; - String decryptable = splat[splat.length-1]; - - String decrypted = encryptor.decrypt(decryptable); - - if (decrypted.startsWith("#%")) - return Optional.of(message.substring(0, message.length() - decryptable.length()) + decrypted.substring(2, decrypted.length())); - else - return Optional.empty(); - } catch (Exception ex) { - return Optional.empty(); - } - } - - public static Component recreate(Component component) { - return Component.Serializer.fromJson(Component.Serializer.toStableJson(component)); - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/core/ServerSafetyState.java b/src/main/java/com/aizistral/nochatreports/common/core/ServerSafetyState.java index 366811f..4b056ff 100644 --- a/src/main/java/com/aizistral/nochatreports/common/core/ServerSafetyState.java +++ b/src/main/java/com/aizistral/nochatreports/common/core/ServerSafetyState.java @@ -26,6 +26,7 @@ public final class ServerSafetyState { private static final AtomicBoolean ALLOW_CHAT_SIGNING = new AtomicBoolean(false); private volatile static ServerSafetyLevel current = ServerSafetyLevel.UNDEFINED; private volatile static ServerAddress lastServer = null; + private volatile static String lastMessage = "???"; public static void updateCurrent(ServerSafetyLevel level) { current = level; @@ -83,6 +84,14 @@ public final class ServerSafetyState { lastServer = address; } + public static String getLastMessage() { + return lastMessage; + } + + public static void setLastMessage(String message) { + lastMessage = message; + } + public static void scheduleResetAction(Runnable action) { RESET_ACTIONS.add(action); } diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/AESCFB8Encryption.java b/src/main/java/com/aizistral/nochatreports/common/encryption/AESCFB8Encryption.java deleted file mode 100644 index 9908ec8..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/AESCFB8Encryption.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.security.InvalidKeyException; - -public class AESCFB8Encryption extends AESEncryption { - - protected AESCFB8Encryption() { - super("CFB8", "NoPadding", true); - } - - @Override - public AESCFB8Encryptor getProcessor(String key) throws InvalidKeyException { - return new AESCFB8Encryptor(key); - } - - @Override - public AESCFB8Encryptor getRandomProcessor() { - try { - return this.getProcessor(this.getRandomKey()); - } catch (InvalidKeyException ex) { - throw new RuntimeException(ex); - } - } - -}
\ No newline at end of file diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/AESCFB8Encryptor.java b/src/main/java/com/aizistral/nochatreports/common/encryption/AESCFB8Encryptor.java deleted file mode 100644 index 682cb91..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/AESCFB8Encryptor.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.nio.ByteBuffer; -import java.security.InvalidKeyException; -import java.security.spec.AlgorithmParameterSpec; -import java.util.Random; - -import javax.crypto.SecretKey; -import javax.crypto.spec.IvParameterSpec; - -import net.minecraft.util.Tuple; - -public class AESCFB8Encryptor extends AESEncryptor<AESCFB8Encryption> { - - protected AESCFB8Encryptor(String key) throws InvalidKeyException { - super(key, Encryption.AES_CFB8); - } - - protected AESCFB8Encryptor(SecretKey key, String mode, String padding, boolean iv) throws InvalidKeyException { - super(key, Encryption.AES_CFB8); - } - - @Override - protected Tuple<AlgorithmParameterSpec, byte[]> generateIV() throws UnsupportedOperationException { - long nonce = RANDOM.nextLong(); - byte[] iv = new byte[16]; - new Random(nonce).nextBytes(iv); - return new Tuple<>(new IvParameterSpec(iv), ByteBuffer.allocate(8).putLong(nonce).array()); - } - - @Override - protected Tuple<AlgorithmParameterSpec, byte[]> splitIV(byte[] message) throws UnsupportedOperationException { - ByteBuffer buffer = ByteBuffer.wrap(message); - int size = buffer.capacity(); - long nonce = buffer.getLong(); - byte[] encrypted = new byte[size - 8]; - buffer.get(encrypted); - byte[] iv = new byte[16]; - new Random(nonce).nextBytes(iv); - return new Tuple<>(new IvParameterSpec(iv), encrypted); - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/AESECBEncryption.java b/src/main/java/com/aizistral/nochatreports/common/encryption/AESECBEncryption.java deleted file mode 100644 index 1c12c51..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/AESECBEncryption.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.security.InvalidKeyException; - -public class AESECBEncryption extends AESEncryption { - - protected AESECBEncryption() { - super("ECB", "PKCS5Padding", false); - } - - @Override - public AESECBEncryptor getProcessor(String key) throws InvalidKeyException { - return new AESECBEncryptor(key); - } - - @Override - public AESECBEncryptor getRandomProcessor() { - try { - return this.getProcessor(this.getRandomKey()); - } catch (InvalidKeyException ex) { - throw new RuntimeException(ex); - } - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/AESECBEncryptor.java b/src/main/java/com/aizistral/nochatreports/common/encryption/AESECBEncryptor.java deleted file mode 100644 index aa1f864..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/AESECBEncryptor.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.security.InvalidKeyException; -import java.security.spec.AlgorithmParameterSpec; - -import javax.crypto.SecretKey; - -import net.minecraft.util.Tuple; - -public class AESECBEncryptor extends AESEncryptor<AESECBEncryption> { - - protected AESECBEncryptor(String key) throws InvalidKeyException { - super(key, Encryption.AES_ECB); - } - - protected AESECBEncryptor(SecretKey key, String mode, String padding, boolean iv) throws InvalidKeyException { - super(key, Encryption.AES_ECB); - } - - @Override - protected Tuple<AlgorithmParameterSpec, byte[]> generateIV() throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - - @Override - protected Tuple<AlgorithmParameterSpec, byte[]> splitIV(byte[] message) throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/AESEncryption.java b/src/main/java/com/aizistral/nochatreports/common/encryption/AESEncryption.java deleted file mode 100644 index 91cd92a..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/AESEncryption.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.KeySpec; -import java.util.Random; - -import javax.crypto.KeyGenerator; -import javax.crypto.SecretKey; -import javax.crypto.SecretKeyFactory; -import javax.crypto.spec.PBEKeySpec; -import javax.crypto.spec.SecretKeySpec; - -import net.minecraft.util.StringUtil; - -public abstract class AESEncryption extends Encryption { - private final String mode, padding; - private final boolean requiresIV; - - protected AESEncryption(String mode, String padding, boolean requiresIV) { - super("aes_" + mode.toLowerCase() + "_base64", "AES/" + mode + "+Base64"); - this.mode = mode; - this.padding = padding; - this.requiresIV = requiresIV; - } - - @Override - public String getRandomKey() { - try { - KeyGenerator keyGenerator = KeyGenerator.getInstance("AES"); - keyGenerator.init(128); - SecretKey key = keyGenerator.generateKey(); - - return BASE64_ENCODER.encodeToString(key.getEncoded()); - } catch (NoSuchAlgorithmException ex) { - throw new RuntimeException(ex); - } - } - - @Override - public String getDefaultKey() { - return "blfrngArk3chG6wzncOZ5A=="; - } - - @Override - public boolean supportsPassphrases() { - return true; - } - - @Override - public String getPassphraseKey(String passphrase) { - try { - byte[] salt = new byte[16]; - new Random(1738389128127L).nextBytes(salt); - - KeySpec spec = new PBEKeySpec(passphrase.toCharArray(), salt, 65536, 128); // AES-128 - SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); - byte[] key = factory.generateSecret(spec).getEncoded(); - - return BASE64_ENCODER.encodeToString(new SecretKeySpec(key, "AES").getEncoded()); - } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) { - throw new RuntimeException(ex); - } - } - - @Override - public boolean validateKey(String key) { - if (StringUtil.isNullOrEmpty(key)) - return false; - - try { - this.getProcessor(key); - } catch (InvalidKeyException ex) { - return false; - } - - return true; - } - - public String getMode() { - return this.mode; - } - - public String getPadding() { - return this.padding; - } - - public boolean requiresIV() { - return this.requiresIV; - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/AESEncryptor.java b/src/main/java/com/aizistral/nochatreports/common/encryption/AESEncryptor.java deleted file mode 100644 index 7e71d91..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/AESEncryptor.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import static javax.crypto.Cipher.DECRYPT_MODE; -import static javax.crypto.Cipher.ENCRYPT_MODE; - -import java.nio.ByteBuffer; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.AlgorithmParameterSpec; - -import javax.crypto.AEADBadTagException; -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.SecretKey; -import javax.crypto.spec.SecretKeySpec; - -import net.minecraft.util.Tuple; - -public abstract class AESEncryptor<T extends AESEncryption> extends Encryptor<T> { - private final T encryption; - private final SecretKey key; - private final Cipher encryptor, decryptor; - private final boolean useIV; - - protected AESEncryptor(String key, T encryption) throws InvalidKeyException { - this(new SecretKeySpec(decodeBinaryKey(key), "AES"), encryption); - } - - protected AESEncryptor(SecretKey key, T encryption) throws InvalidKeyException { - this.encryption = encryption; - this.useIV = encryption.requiresIV(); - String mode = encryption.getMode(); - String padding = encryption.getPadding(); - - try { - this.key = key; - - Cipher encryptor = Cipher.getInstance(this.key.getAlgorithm() + "/" + mode + "/" + padding); - if (this.useIV) { - encryptor.init(ENCRYPT_MODE, this.key, this.generateIV().getA()); - } else { - encryptor.init(ENCRYPT_MODE, this.key); - - } - this.encryptor = encryptor; - - Cipher decryptor = Cipher.getInstance(this.key.getAlgorithm() + "/" + mode + "/" + padding); - if (this.useIV) { - decryptor.init(DECRYPT_MODE, this.key, this.generateIV().getA()); - } else { - decryptor.init(DECRYPT_MODE, this.key); - } - this.decryptor = decryptor; - } catch (NoSuchAlgorithmException | NoSuchPaddingException ex) { - throw new RuntimeException(ex); - } catch (InvalidAlgorithmParameterException ex) { - throw new InvalidKeyException(ex); - } - } - - @Override - public String encrypt(String message) { - try { - if (this.useIV) { - var tuple = this.generateIV(); - - this.encryptor.init(ENCRYPT_MODE, this.key, tuple.getA()); - byte[] encrypted = this.encryptor.doFinal(toBytes(message)); - - return encodeBase64R(ByteBuffer.allocate(encrypted.length + tuple.getB().length).put(tuple.getB()) - .put(encrypted).array()); - } else - return encodeBase64R(this.encryptor.doFinal(toBytes(message))); - } catch (IllegalBlockSizeException | BadPaddingException | InvalidKeyException | InvalidAlgorithmParameterException ex) { - throw new RuntimeException(ex); - } - } - - @Override - public String decrypt(String message) { - try { - if (this.useIV) { - var tuple = this.splitIV(decodeBase64RBytes(message)); - - this.decryptor.init(DECRYPT_MODE, this.key, tuple.getA()); - return fromBytes(this.decryptor.doFinal(tuple.getB())); - } else - return fromBytes(this.decryptor.doFinal(decodeBase64RBytes(message))); - } catch (AEADBadTagException ex) { - return "???"; - } catch (IllegalBlockSizeException | BadPaddingException | InvalidKeyException | InvalidAlgorithmParameterException ex) { - throw new RuntimeException(ex); - } - } - - @Override - public String getKey() { - return encodeBinaryKey(this.key.getEncoded()); - } - - @Override - public T getAlgorithm() { - return this.encryption; - } - - protected abstract Tuple<AlgorithmParameterSpec, byte[]> generateIV() throws UnsupportedOperationException; - - protected abstract Tuple<AlgorithmParameterSpec, byte[]> splitIV(byte[] message) throws UnsupportedOperationException; - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/AESGCMEncryption.java b/src/main/java/com/aizistral/nochatreports/common/encryption/AESGCMEncryption.java deleted file mode 100644 index d94b6fc..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/AESGCMEncryption.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.security.InvalidKeyException; - -public class AESGCMEncryption extends AESEncryption { - - protected AESGCMEncryption() { - super("GCM", "NoPadding", true); - } - - @Override - public AESGCMEncryptor getProcessor(String key) throws InvalidKeyException { - return new AESGCMEncryptor(key); - } - - @Override - public AESGCMEncryptor getRandomProcessor() { - try { - return this.getProcessor(this.getRandomKey()); - } catch (InvalidKeyException ex) { - throw new RuntimeException(ex); - } - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/AESGCMEncryptor.java b/src/main/java/com/aizistral/nochatreports/common/encryption/AESGCMEncryptor.java deleted file mode 100644 index f91a0ab..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/AESGCMEncryptor.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.nio.ByteBuffer; -import java.security.InvalidKeyException; -import java.security.spec.AlgorithmParameterSpec; - -import javax.crypto.SecretKey; -import javax.crypto.spec.GCMParameterSpec; - -import net.minecraft.util.Tuple; - -public class AESGCMEncryptor extends AESEncryptor<AESGCMEncryption> { - - protected AESGCMEncryptor(String key) throws InvalidKeyException { - super(key, Encryption.AES_GCM); - } - - protected AESGCMEncryptor(SecretKey key) throws InvalidKeyException { - super(key, Encryption.AES_GCM); - } - - @Override - protected Tuple<AlgorithmParameterSpec, byte[]> generateIV() throws UnsupportedOperationException { - byte[] iv = new byte[12]; - RANDOM.nextBytes(iv); - return new Tuple<>(new GCMParameterSpec(96, iv), iv); - } - - @Override - protected Tuple<AlgorithmParameterSpec, byte[]> splitIV(byte[] message) throws UnsupportedOperationException { - byte[] iv = new byte[12]; - byte[] msg = new byte[message.length - 12]; - ByteBuffer.wrap(message).get(iv).get(msg); - return new Tuple<>(new GCMParameterSpec(96, iv), msg); - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/CaesarEncryption.java b/src/main/java/com/aizistral/nochatreports/common/encryption/CaesarEncryption.java deleted file mode 100644 index 27a1261..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/CaesarEncryption.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.security.InvalidKeyException; -import java.security.SecureRandom; - -public class CaesarEncryption extends Encryption { - - protected CaesarEncryption() { - super("caesar", "Caesar"); - } - - @Override - public String getRandomKey() { - return String.valueOf(1 + new SecureRandom().nextInt(1024)); - } - - @Override - public String getDefaultKey() { - return "3"; - } - - @Override - public boolean supportsPassphrases() { - return false; - } - - @Override - public String getPassphraseKey(String passphrase) throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - - @Override - public boolean validateKey(String key) { - try { - int value = Integer.valueOf(key); - return value > 0 && value < 1025; - } catch (NumberFormatException ex) { - return false; - } - } - - @Override - public CaesarEncryptor getProcessor(String key) throws InvalidKeyException { - return new CaesarEncryptor(key); - } - - @Override - public CaesarEncryptor getRandomProcessor() { - try { - return this.getProcessor(this.getRandomKey()); - } catch (InvalidKeyException ex) { - throw new RuntimeException(ex); - } - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/CaesarEncryptor.java b/src/main/java/com/aizistral/nochatreports/common/encryption/CaesarEncryptor.java deleted file mode 100644 index 7eb8010..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/CaesarEncryptor.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.security.InvalidKeyException; - -public class CaesarEncryptor extends Encryptor<CaesarEncryption> { - private static final char PARAGRAPH = '\u00a7', PARAGRAPH_PLACEHOLDER = '\uffef', - DELETE = '\u007f', DELETE_PLACEHOLDER = '\ufff0'; - private final int shift; - - protected CaesarEncryptor(int shift) throws InvalidKeyException { - if (!Encryption.CAESAR.validateKey(String.valueOf(shift))) - throw new InvalidKeyException(); - this.shift = shift; - } - - protected CaesarEncryptor(String key) throws InvalidKeyException { - this.shift = fromString(key); - } - - @Override - public String encrypt(String message) { - char[] chars = ensureUTF8(message).toCharArray(); - - for (int i = 0; i < chars.length; i++) { - chars[i] = (char) (chars[i] + this.shift); - - if (chars[i] == PARAGRAPH) { - chars[i] = PARAGRAPH_PLACEHOLDER; - } else if (chars[i] == DELETE) { - chars[i] = DELETE_PLACEHOLDER; - } - } - - return new String(chars); - } - - @Override - public String decrypt(String message) { - char[] chars = ensureUTF8(message).toCharArray(); - - for (int i = 0; i < chars.length; i++) { - if (chars[i] == PARAGRAPH_PLACEHOLDER) { - chars[i] = PARAGRAPH; - } else if (chars[i] == DELETE_PLACEHOLDER) { - chars[i] = DELETE; - } - - chars[i] = (char) (chars[i] - this.shift); - } - - return new String(chars); - } - - @Override - public CaesarEncryption getAlgorithm() { - return Encryption.CAESAR; - } - - @Override - public String getKey() { - return String.valueOf(this.shift); - } - - private static int fromString(String key) throws InvalidKeyException { - if (!Encryption.CAESAR.validateKey(key)) - throw new InvalidKeyException(key); - return Integer.valueOf(key); - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/Encryption.java b/src/main/java/com/aizistral/nochatreports/common/encryption/Encryption.java deleted file mode 100644 index 259d89d..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/Encryption.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.security.InvalidKeyException; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Collections; -import java.util.List; - -public abstract class Encryption { - private static final List<Encryption> REGISTERED = new ArrayList<>(); - protected static final Base64.Encoder BASE64_ENCODER = Base64.getEncoder(); - protected static final Base64.Decoder BASE64_DECODER = Base64.getDecoder(); - - public static final AESCFB8Encryption AES_CFB8 = new AESCFB8Encryption(); - public static final AESGCMEncryption AES_GCM = new AESGCMEncryption(); - public static final AESECBEncryption AES_ECB = new AESECBEncryption(); - public static final CaesarEncryption CAESAR = new CaesarEncryption(); - - private final String id, name; - - protected Encryption(String id, String name) { - this.id = id; - this.name = name; - - if (REGISTERED.stream().filter(e -> e.getID().equals(id) || e.getName().equals(name)) - .findAny().isPresent()) - throw new IllegalStateException("Duplicate encryption algorithm registered! ID: " + this.getID() + - ", Name: " + this.getName()); - - REGISTERED.add(this); - } - - public String getID() { - return this.id; - } - - public String getName() { - return this.name; - } - - public abstract String getRandomKey(); - - public abstract String getDefaultKey(); - - public abstract boolean supportsPassphrases(); - - public abstract String getPassphraseKey(String passphrase) throws UnsupportedOperationException; - - public abstract boolean validateKey(String key); - - public abstract Encryptor<?> getProcessor(String key) throws InvalidKeyException; - - public abstract Encryptor<?> getRandomProcessor(); - - public static List<Encryption> getRegistered() { - return Collections.unmodifiableList(REGISTERED); - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/encryption/Encryptor.java b/src/main/java/com/aizistral/nochatreports/common/encryption/Encryptor.java deleted file mode 100644 index 61718a4..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/encryption/Encryptor.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.aizistral.nochatreports.common.encryption; - -import java.nio.charset.StandardCharsets; -import java.security.InvalidKeyException; -import java.security.SecureRandom; -import java.util.Arrays; - -import it.unimi.dsi.fastutil.chars.Char2CharArrayMap; -import it.unimi.dsi.fastutil.chars.Char2CharMap; -import it.unimi.dsi.fastutil.chars.Char2CharMaps; - -public abstract class Encryptor<T extends Encryption> { - protected static final SecureRandom RANDOM = new SecureRandom(); - protected static final Char2CharMap BASE64R_SHIFTS = createBase64RShifts(); - protected static final Char2CharMap BASE64R_SHIFTS_REVERSE = createBase64RShiftsReverse(); - - protected Encryptor() { - // NO-OP - } - - public abstract String encrypt(String message); - - public abstract String decrypt(String message); - - public abstract T getAlgorithm(); - - public abstract String getKey(); - - protected static String shiftBase64R(String string) { - char[] chars = ensureUTF8(string).toCharArray(); - - for (int i = 0; i < chars.length; i++) { - chars[i] = BASE64R_SHIFTS.get(chars[i]); - } - - return new String(chars); - } - - protected static String unshiftBase64R(String string) { - char[] chars = ensureUTF8(string).toCharArray(); - - for (int i = 0; i < chars.length; i++) { - chars[i] = BASE64R_SHIFTS_REVERSE.get(chars[i]); - } - - return new String(chars); - } - - protected static byte[] toBytes(String string) { - return string.getBytes(StandardCharsets.UTF_8); - } - - protected static String fromBytes(byte[] bytes) { - return new String(bytes, StandardCharsets.UTF_8); - } - - protected static String ensureUTF8(String string) { - return fromBytes(toBytes(string)); - } - - protected static String encodeBase64R(String string) { - return encodeBase64R(toBytes(string)); - } - - protected static String encodeBase64R(byte[] bytes) { - return shiftBase64R(fromBytes(Encryption.BASE64_ENCODER.encode(bytes))); - } - - protected static byte[] encodeBase64RBytes(String string) { - return toBytes(encodeBase64R(toBytes(string))); - } - - protected static String decodeBase64R(String string) { - return fromBytes(decodeBase64RBytes(string)); - } - - protected static byte[] decodeBase64RBytes(String string) { - return Encryption.BASE64_DECODER.decode(toBytes(unshiftBase64R(string))); - } - - protected static String encodeBinaryKey(byte[] key) { - return fromBytes(Encryption.BASE64_ENCODER.encode(key)); - } - - protected static byte[] decodeBinaryKey(String key) throws InvalidKeyException { - try { - return Encryption.BASE64_DECODER.decode(toBytes(key)); - } catch (Exception ex) { - throw new InvalidKeyException(ex); - } - } - - protected static byte[] mergeBytes(byte[] array1, byte[] array2) { - byte[] result = Arrays.copyOf(array1, array1.length + array2.length); - System.arraycopy(array2, 0, result, array1.length, array2.length); - return result; - } - - private static Char2CharMap createBase64RShiftsReverse() { - Char2CharMap map = createBase64RShifts(); - Char2CharMap reverse = new Char2CharArrayMap(64); - - for (char ch : map.keySet()) { - reverse.put(map.get(ch), ch); - } - - return Char2CharMaps.unmodifiable(reverse); - } - - private static Char2CharMap createBase64RShifts() { - Char2CharMap map = new Char2CharArrayMap(64); - - map.put('A', '!'); - map.put('B', '"'); - map.put('C', '#'); - map.put('D', '$'); - map.put('E', '%'); - map.put('F', '¼'); - map.put('G', '\''); - map.put('H', '('); - map.put('I', ')'); - map.put('J', ','); - map.put('K', '-'); - map.put('L', '.'); - map.put('M', ':'); - map.put('N', ';'); - map.put('O', '<'); - map.put('P', '='); - map.put('Q', '>'); - map.put('R', '?'); - map.put('S', '@'); - map.put('T', '['); - map.put('U', '\\'); - map.put('V', ']'); - map.put('W', '^'); - map.put('X', '_'); - map.put('Y', '`'); - map.put('Z', '{'); - map.put('a', '|'); - map.put('b', '}'); - map.put('c', '~'); - map.put('d', '¡'); - map.put('e', '¢'); - map.put('f', '£'); - map.put('g', '¤'); - map.put('h', '¥'); - map.put('i', '¦'); - map.put('j', '¨'); - map.put('k', '©'); - map.put('l', 'ª'); - map.put('m', '«'); - map.put('n', '¬'); - map.put('o', '®'); - map.put('p', '¯'); - map.put('q', '°'); - map.put('r', '±'); - map.put('s', '²'); - map.put('t', '³'); - map.put('u', 'µ'); - map.put('v', '¶'); - map.put('w', '·'); - map.put('x', '×'); - map.put('y', '¹'); - map.put('z', 'º'); - map.put('0', '0'); - map.put('1', '1'); - map.put('2', '2'); - map.put('3', '3'); - map.put('4', '4'); - map.put('5', '5'); - map.put('6', '6'); - map.put('7', '7'); - map.put('8', '8'); - map.put('9', '9'); - map.put('+', '+'); - map.put('/', '»'); - map.put('=', '¿'); - - return Char2CharMaps.unmodifiable(map); - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionButton.java b/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionButton.java deleted file mode 100644 index 44d286f..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionButton.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.aizistral.nochatreports.common.gui; - -import com.aizistral.nochatreports.common.config.NCRConfig; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.screens.Screen; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; - -public class EncryptionButton extends AdvancedImageButton { - - public EncryptionButton(int x, int y, int xSize, int ySize, int xTexStart, int yTexStart, int yStateDiff, - ResourceLocation texture, int textureWidth, int textureHeight, OnPress onPress, Component name, Screen parent) { - super(x, y, xSize, ySize, xTexStart, yTexStart, yStateDiff, texture, textureWidth, textureHeight, onPress, name, parent); - } - - @Override - public boolean mouseClicked(double x, double y, int i) { - if (!this.active || !this.visible) - return false; - - if (i == 1 && this.clicked(x, y)) { - this.playDownSound(Minecraft.getInstance().getSoundManager()); - this.openEncryptionConfig(); - return true; - } - - return super.mouseClicked(x, y, i); - } - - public void openEncryptionConfig() { - if (!EncryptionWarningScreen.seenOnThisSession() && !NCRConfig.getEncryption().isWarningDisabled() - && !NCRConfig.getEncryption().isEnabledAndValid()) { - Minecraft.getInstance().setScreen(new EncryptionWarningScreen(this.parent)); - } else { - Minecraft.getInstance().setScreen(new EncryptionConfigScreen(this.parent)); - } - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionConfigScreen.java b/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionConfigScreen.java deleted file mode 100644 index c0cdb47..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionConfigScreen.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.aizistral.nochatreports.common.gui; - -import java.util.Objects; - -import com.aizistral.nochatreports.common.config.NCRConfig; -import com.aizistral.nochatreports.common.config.NCRConfigEncryption; -import com.aizistral.nochatreports.common.encryption.Encryption; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.client.gui.Font; -import net.minecraft.client.gui.components.Button; -import net.minecraft.client.gui.components.Checkbox; -import net.minecraft.client.gui.components.CycleButton; -import net.minecraft.client.gui.components.EditBox; -import net.minecraft.client.gui.components.ImageButton; -import net.minecraft.client.gui.components.MultiLineLabel; -import net.minecraft.client.gui.screens.Screen; -import net.minecraft.network.chat.CommonComponents; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.StringUtil; - -@Environment(EnvType.CLIENT) -public class EncryptionConfigScreen extends Screen { - private static final ResourceLocation ENCRYPTION_ICONS = new ResourceLocation("nochatreports", "textures/gui/encryption_gui_icons.png"); - private static final Component HEADER = Component.translatable("gui.nochatreports.encryption_config.header"); - private static final Component KEY_DESC = Component.translatable("gui.nochatreports.encryption_config.key_desc"); - private static final Component PASS_DESC = Component.translatable("gui.nochatreports.encryption_config.passphrase_desc"); - private static final Component VALIDATION_OK = Component.translatable("gui.nochatreports.encryption_config.validation_ok"); - private static final Component VALIDATION_FAILED = Component.translatable("gui.nochatreports.encryption_config.validation_failed"); - private static final Component DICE_TOOLTIP = Component.translatable("gui.nochatreports.encryption_config.dice_tooltip"); - private static final Component PASS_NOT_ALLOWED = Component.translatable("gui.nochatreports.encryption_config.pass_not_allowed"); - private static final Component ENCRYPT_PUBLIC = Component.translatable("gui.nochatreports.encryption_config.encrypt_public"); - - private static final int FIELDS_Y_START = 45; - private final Screen previous; - private CustomEditBox keyField, passField; - private ImageButton validationIcon; - private CycleButton<Encryption> algorithmButton; - private MultiLineLabel keyDesc = MultiLineLabel.EMPTY, passDesc = MultiLineLabel.EMPTY; - protected Checkbox encryptPublicCheck; - private boolean settingPassKey = false; - - public EncryptionConfigScreen(Screen previous) { - super(CommonComponents.EMPTY); - this.previous = previous; - } - - private NCRConfigEncryption getConfig() { - return NCRConfig.getEncryption(); - } - - @Override - protected void init() { - this.clearWidgets(); - super.init(); - - int w = (int) (this.width * (this.hugeGUI() ? 0.9 : 0.7)); - - this.keyDesc = MultiLineLabel.create(this.font, KEY_DESC, w - 5); - int keyDescSpace = (this.keyDesc.getLineCount() + 1) * this.getLineHeight(); - - this.passDesc = MultiLineLabel.create(this.font, PASS_DESC, w - 5); - int passDescSpace = (this.passDesc.getLineCount() + 1) * this.getLineHeight(); - - w -= 52; - - this.keyField = new CustomEditBox(this.font, (this.width - w)/2 - 2, (this.hugeGUI() ? 25 : FIELDS_Y_START) + keyDescSpace - 15, - w, 18, CommonComponents.EMPTY); - this.keyField.setMaxLength(512); - this.keyField.setResponder(this::onKeyUpdate); - this.addWidget(this.keyField); - - var button = new AdvancedImageButton(this.keyField.getX() + this.keyField.getWidth() - 15, this.keyField.getY() + 3, 12, - 12, 0, 0, 0, ENCRYPTION_ICONS, 64, 64, btn -> {}, Component.empty(), this); - button.setTooltip(new AdvancedTooltip(() -> this.validationIcon != null && - this.validationIcon.yTexStart == 0 ? VALIDATION_OK : VALIDATION_FAILED).setMaxWidth(250)); - button.active = false; - button.visible = true; - - this.addRenderableOnly(this.validationIcon = button); - - button = new AdvancedImageButton(this.keyField.getX() - 22, this.keyField.getY() - 0, 18, 18, 0, - 28, 0, ENCRYPTION_ICONS, 64, 64, btn -> {}, Component.empty(), this); - button.active = false; - button.visible = true; - - this.addRenderableOnly(button); - - button = new AdvancedImageButton(this.keyField.getX() + this.keyField.getWidth() + 4, this.keyField.getY() - 1, 23, 20, 41, - 24, 20, ENCRYPTION_ICONS, 64, 64, btn -> { - this.unfocusFields(); - this.keyField.setValue(this.algorithmButton.getValue().getRandomKey()); - }, Component.empty(), this); - button.setTooltip(new AdvancedTooltip(DICE_TOOLTIP).setMaxWidth(250)); - button.active = true; - button.visible = true; - - this.addRenderableWidget(button); - - w += 25; - - this.passField = new CustomEditBox(this.font, (this.width - w)/2 + 11, this.keyField.getY() + - this.keyField.getHeight() + passDescSpace + (this.hugeGUI() ? -3 : 13), w, 18, CommonComponents.EMPTY); - this.passField.setMaxLength(512); - this.passField.setResponder(this::onPassphraseUpdate); - this.addWidget(this.passField); - - button = new AdvancedImageButton(this.passField.getX() - 22, this.passField.getY() - 0, 18, 18, 0, - 46, 0, ENCRYPTION_ICONS, 64, 64, btn -> {}, Component.empty(), this); - button.active = false; - button.visible = true; - - this.addRenderableOnly(button); - - int checkWidth = this.font.width(ENCRYPT_PUBLIC); - this.encryptPublicCheck = new Checkbox(this.width / 2 - checkWidth / 2 - 8, this.passField.getY() + 24, checkWidth + 24, 20, - ENCRYPT_PUBLIC, NCRConfig.getEncryption().shouldEncryptPublic()); - this.addRenderableWidget(this.encryptPublicCheck); - - this.addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, btn -> { - this.onDone(); - this.onClose(); - }).pos(this.width / 2 + 4, this.passField.getY() + 48).size(219, 20).build()); - - CycleButton<Encryption> cycle = CycleButton.<Encryption>builder(value -> { - return Component.translatable("gui.nochatreports.encryption_config.algorithm", - Component.translatable("algorithm.nochatreports." + value.getID() + ".name")); - }).withValues(Encryption.getRegistered()).displayOnlyValue().withInitialValue(this.getConfig() - .getAlgorithm()).withTooltip(value -> new AdvancedTooltip(Component.translatable( - "algorithm.nochatreports." + value.getID())).setMaxWidth(250)) - .create(this.width / 2 - 4 - 218, this.passField.getY() + 48, 218, 20, CommonComponents.EMPTY, - (cycleButton, value) -> { - this.unfocusFields(); - this.onAlgorithmUpdate(value); - }); - - this.addRenderableWidget(this.algorithmButton = cycle); - - this.onAlgorithmUpdate(this.algorithmButton.getValue()); - - if (!StringUtil.isNullOrEmpty(this.getConfig().getEncryptionPassphrase())) { - this.passField.setValue(this.getConfig().getEncryptionPassphrase()); - } else if (!StringUtil.isNullOrEmpty(this.getConfig().getEncryptionKey())) { - if (!Objects.equals(this.getConfig().getEncryptionKey(), this.algorithmButton.getValue() - .getDefaultKey())) { - this.keyField.setValue(this.getConfig().getEncryptionKey()); - } else { - this.keyField.setValue(""); - } - } - } - - @Override - public void render(PoseStack poseStack, int i, int j, float f) { - if (!this.passField.isActive()) { - if (this.passField.isFocused()) { - this.passField.setFocused(false); - } - this.passField.setEditable(false); - } - - this.renderBackground(poseStack); - Screen.drawCenteredString(poseStack, this.font, HEADER, this.width / 2, this.hugeGUI() ? 8 : 16, 0xFFFFFF); - - this.keyDesc.renderLeftAligned(poseStack, this.keyField.getX() - 20, (this.hugeGUI() ? 25 : FIELDS_Y_START), this.getLineHeight(), 0xFFFFFF); - - this.keyField.render(poseStack, i, j, f); - - this.passDesc.renderLeftAligned(poseStack, this.passField.getX() - 20, this.keyField.getY() + this.keyField.getHeight() + (this.hugeGUI() ? 12 : 28), - this.getLineHeight(), 0xFFFFFF); - - this.passField.render(poseStack, i, j, f); - - // if (this.algorithmButton != null && this.algorithmButton.isMouseOver(i, j)) { - // this.renderTooltip(poseStack, this.algorithmButton.getTooltip(), i, j); - // } - - super.render(poseStack, i, j, f); - - if (StringUtil.isNullOrEmpty(this.keyField.getValue()) && !this.keyField.isFocused()) { - Screen.drawString(poseStack, this.font, - Component.translatable("gui.nochatreports.encryption_config.default_key", - this.algorithmButton.getValue().getDefaultKey()), this.keyField.getX() + 4, - this.keyField.getY() + 5, 0x999999); - } - - if (!this.passField.active) { - Screen.drawString(poseStack, this.font, PASS_NOT_ALLOWED, this.passField.getX() + 4, - this.passField.getY() + 5, 0x999999); - RenderSystem.setShaderTexture(0, ENCRYPTION_ICONS); - RenderSystem.enableDepthTest(); - blit(poseStack, this.passField.getX() - 20, this.passField.getY() + 3, 50, 0, 14, 13, 64, 64); - } - } - - private int getLineHeight() { - if (this.hugeGUI()) - return (int) (this.minecraft.font.lineHeight * 1.5) + 1; - else - return this.minecraft.font.lineHeight * 2; - } - - @Override - public void tick() { - this.keyField.tick(); - } - - private void onKeyUpdate(String key) { - if (!this.settingPassKey) { - this.passField.setValue(""); - } - - if (!StringUtil.isNullOrEmpty(key)) { - this.validationIcon.yTexStart = this.algorithmButton.getValue().validateKey(key) ? 0 : 12; - } else { - this.validationIcon.yTexStart = 0; - } - } - - private void onPassphraseUpdate(String pass) { - Encryption encryption = this.algorithmButton.getValue(); - - this.settingPassKey = true; - if (!StringUtil.isNullOrEmpty(pass)) { - if (encryption.supportsPassphrases()) { - this.keyField.setValue(encryption.getPassphraseKey(pass)); - } - } else { - this.onKeyUpdate(this.keyField.getValue()); - } - this.settingPassKey = false; - } - - private void onAlgorithmUpdate(Encryption encryption) { - if (!encryption.supportsPassphrases()) { - this.passField.setFocused(false); - this.passField.setEditable(this.passField.active = false); - this.onKeyUpdate(this.keyField.getValue()); - } else { - this.passField.setEditable(this.passField.active = true); - this.onPassphraseUpdate(this.passField.getValue()); - } - } - - private void unfocusFields() { - this.keyField.setFocused(false); - this.passField.setFocused(false); - } - - private void onDone() { - var config = NCRConfig.getEncryption(); - var encryption = this.algorithmButton.getValue(); - config.setAlgorithm(encryption); - config.setEncryptionKey(!StringUtil.isNullOrEmpty(this.keyField.getValue()) ? this.keyField.getValue() - : encryption.getDefaultKey()); - config.setEncryptPublic(this.encryptPublicCheck.selected()); - } - - private boolean hugeGUI() { - return this.height <= 1080 / 4; - } - - @Override - public void onClose() { - this.minecraft.setScreen(this.previous); - } - - private static class CustomEditBox extends EditBox { - public CustomEditBox(Font font, int i, int j, int k, int l, Component component) { - super(font, i, j, k, l, component); - } - - @Override - public void setFocused(boolean bl) { - super.setFocused(bl); - } - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionWarningScreen.java b/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionWarningScreen.java deleted file mode 100644 index 954c6f3..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/gui/EncryptionWarningScreen.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.aizistral.nochatreports.common.gui; - -import com.aizistral.nochatreports.common.config.NCRConfig; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.ChatFormatting; -import net.minecraft.client.gui.components.Button; -import net.minecraft.client.gui.screens.Screen; -import net.minecraft.network.chat.Component; - -@Environment(EnvType.CLIENT) -public class EncryptionWarningScreen extends TriageWarningScreen { - private static final Component TITLE = Component.translatable("gui.nochatreports.encryption_warning.header").withStyle(ChatFormatting.BOLD); - private static final Component CONTENT = Component.translatable("gui.nochatreports.encryption_warning.contents"); - private static final Component CHECK = Component.translatable("gui.nochatreports.encryption_warning.check"); - private static final String WIKI_LINK = "https://github.com/Aizistral-Studios/No-Chat-Reports/wiki/To-Encrypt-or-Not-to-Encrypt"; - private static boolean sessionSeen = false; - - public EncryptionWarningScreen(Screen previous) { - super(TITLE, CONTENT, CHECK, WIKI_LINK, previous); - } - - @Override - protected void onProceed(Button button) { - this.minecraft.setScreen(new EncryptionConfigScreen(this.previous)); - if (this.stopShowing.selected()) { - NCRConfig.getEncryption().disableWarning(); - } - - sessionSeen = true; - } - - @Override - protected void onBack(Button button) { - this.minecraft.setScreen(this.previous); - } - - public static boolean seenOnThisSession() { - return sessionSeen; - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/gui/UnsafeServerScreen.java b/src/main/java/com/aizistral/nochatreports/common/gui/UnsafeServerScreen.java index 239b23b..a46ce21 100644 --- a/src/main/java/com/aizistral/nochatreports/common/gui/UnsafeServerScreen.java +++ b/src/main/java/com/aizistral/nochatreports/common/gui/UnsafeServerScreen.java @@ -41,12 +41,6 @@ public final class UnsafeServerScreen extends AdaptiveWarningScreen { }).bounds(this.width / 2 - 155 + 160, i, 150, 20).build()); } - private void resendLastMessage() { - if (this.previous instanceof ChatScreen chat) { - chat.handleChatInput(NCRConfig.getEncryption().getLastMessage(), false); - } - } - public static void setHideThisSession(boolean hide) { hideThisSession = hide; } diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatComponent.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatComponent.java deleted file mode 100644 index 273ea57..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatComponent.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.aizistral.nochatreports.common.mixins.client; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.At.Shift; - -import com.aizistral.nochatreports.common.NCRCore; -import com.aizistral.nochatreports.common.config.NCRConfig; -import com.aizistral.nochatreports.common.core.EncryptionUtil; - -import org.spongepowered.asm.mixin.injection.ModifyArg; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -import net.minecraft.ChatFormatting; -import net.minecraft.client.GuiMessageTag; -import net.minecraft.client.gui.components.ChatComponent; -import net.minecraft.network.chat.CommonComponents; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.FormattedText; - -@Mixin(ChatComponent.class) -public class MixinChatComponent { - private static final GuiMessageTag.Icon ENCRYPTED_ICON = GuiMessageTag.Icon.valueOf("CHAT_NCR_ENCRYPTED"); - private boolean lastMessageEncrypted; - private Component lastMessageOriginal; - - @ModifyVariable(method = "addRecentChat", at = @At("HEAD"), argsOnly = true) - private String onAddRecentChat(String message) { - if (NCRConfig.getEncryption().isEnabledAndValid()) - return NCRConfig.getEncryption().getLastMessage(); - else - return message; - } - - @ModifyVariable(method = "addMessage(Lnet/minecraft/network/chat/Component;" - + "Lnet/minecraft/network/chat/MessageSignature;ILnet/minecraft/client/GuiMessageTag;Z)V", - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/ComponentRenderUtils;" - + "wrapComponents(Lnet/minecraft/network/chat/FormattedText;ILnet/minecraft/client/gui/Font;" - + ")Ljava/util/List;", ordinal = 0, shift = Shift.AFTER), argsOnly = true) - private synchronized GuiMessageTag modifyGUITag(GuiMessageTag tag) { - if (!NCRConfig.getEncryption().showEncryptionIndicators() || !this.lastMessageEncrypted) - return tag; - - this.lastMessageEncrypted = false; - Component tooltip = Component.empty().append(Component.translatable("tag.nochatreports.encrypted", - Component.literal(NCRConfig.getEncryption().getAlgorithm().getName()) - .withStyle(ChatFormatting.BOLD))).append(CommonComponents.NEW_LINE).append( - Component.translatable("tag.nochatreports.encrypted_original", - this.lastMessageOriginal)); - - return new GuiMessageTag(0x8B3EC7, ENCRYPTED_ICON, tooltip, "Encrypted"); - } - - @ModifyArg(index = 0, method = "addMessage(Lnet/minecraft/network/chat/Component;" - + "Lnet/minecraft/network/chat/MessageSignature;ILnet/minecraft/client/GuiMessageTag;Z)V", - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/ComponentRenderUtils;" - + "wrapComponents(Lnet/minecraft/network/chat/FormattedText;I" - + "Lnet/minecraft/client/gui/Font;)Ljava/util/List;", ordinal = 0)) - private FormattedText modifyGUIMessage(FormattedText msg) { - if (NCRConfig.getCommon().enableDebugLog()) { - NCRCore.LOGGER.info("Adding chat message, structure: " + - Component.Serializer.toStableJson((Component) msg)); - } - - var decrypted = EncryptionUtil.tryDecrypt((Component) msg); - - decrypted.ifPresentOrElse(component -> { - this.lastMessageOriginal = EncryptionUtil.recreate((Component) msg); - this.lastMessageEncrypted = true; - }, () -> this.lastMessageEncrypted = false); - - return this.lastMessageEncrypted ? decrypted.get() : msg; - } - -} diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatListener.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatListener.java index f0a6d8c..de43da6 100644 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatListener.java +++ b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatListener.java @@ -8,14 +8,12 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.aizistral.nochatreports.common.NCRClient; import com.aizistral.nochatreports.common.NCRCore; import com.aizistral.nochatreports.common.config.NCRConfig; -import com.aizistral.nochatreports.common.core.EncryptionUtil; import com.aizistral.nochatreports.common.core.ServerSafetyLevel; import com.aizistral.nochatreports.common.core.ServerSafetyState; import com.aizistral.nochatreports.common.core.SigningMode; @@ -108,10 +106,4 @@ public class MixinChatListener { } } - @ModifyVariable(method = "narrateChatMessage(Lnet/minecraft/network/chat/ChatType$Bound;" - + "Lnet/minecraft/network/chat/Component;)V", at = @At("HEAD"), argsOnly = true) - private Component decryptNarratedMessage(Component msg) { - return EncryptionUtil.tryDecrypt(msg).orElse(msg); - } - } diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatScreen.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatScreen.java index 46e9ebd..b7be2fb 100644 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatScreen.java +++ b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinChatScreen.java @@ -14,16 +14,12 @@ import com.aizistral.nochatreports.common.core.ServerSafetyState; import com.aizistral.nochatreports.common.core.SigningMode; import com.aizistral.nochatreports.common.gui.AdvancedImageButton; import com.aizistral.nochatreports.common.gui.AdvancedTooltip; -import com.aizistral.nochatreports.common.gui.EncryptionButton; -import com.aizistral.nochatreports.common.gui.EncryptionWarningScreen; import net.minecraft.ChatFormatting; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.ImageButton; import net.minecraft.client.gui.screens.ChatScreen; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.multiplayer.resolver.ServerAddress; -import net.minecraft.locale.Language; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; @@ -36,7 +32,6 @@ import net.minecraft.resources.ResourceLocation; @Mixin(ChatScreen.class) public abstract class MixinChatScreen extends Screen { private static final ResourceLocation CHAT_STATUS_ICONS = new ResourceLocation("nochatreports", "textures/gui/chat_status_icons_extended.png"); - private static final ResourceLocation ENCRYPTION_BUTTON = new ResourceLocation("nochatreports", "textures/gui/encryption_toggle_button.png"); private ImageButton safetyStatusButton; protected MixinChatScreen() { @@ -61,19 +56,7 @@ public abstract class MixinChatScreen extends Screen { @Inject(method = "normalizeChatMessage", at = @At("RETURN"), cancellable = true) public void onBeforeMessage(String original, CallbackInfoReturnable<String> info) { String message = info.getReturnValue(); - NCRConfig.getEncryption().setLastMessage(message); - - if (!message.isEmpty() && !Screen.hasControlDown() && NCRConfig.getEncryption().shouldEncrypt(message)) { - NCRConfig.getEncryption().getEncryptor().ifPresent(e -> { - int index = NCRConfig.getEncryption().getEncryptionStartIndex(message); - String noencrypt = message.substring(0, index); - String encrypt = message.substring(index, message.length()); - - if (encrypt.length() > 0) { - info.setReturnValue(noencrypt + e.encrypt("#%" + encrypt)); - } - }); - } + ServerSafetyState.setLastMessage(message); } @Inject(method = "init", at = @At("HEAD")) @@ -142,38 +125,6 @@ public abstract class MixinChatScreen extends Screen { this.addRenderableWidget(this.safetyStatusButton); buttonX -= 25; } - - if (!NCRConfig.getEncryption().showEncryptionButton()) - return; - - int xStart = !NCRConfig.getEncryption().isValid() ? 40 : (NCRConfig.getEncryption().isEnabled() ? 0 : 20); - - var button = new EncryptionButton(buttonX, this.height - 37, 20, 20, xStart, - 0, 20, ENCRYPTION_BUTTON, 64, 64, btn -> { - if (!EncryptionWarningScreen.seenOnThisSession() && !NCRConfig.getEncryption().isWarningDisabled() - && !NCRConfig.getEncryption().isEnabled()) { - Minecraft.getInstance().setScreen(new EncryptionWarningScreen(this)); - } else if (NCRConfig.getEncryption().isValid()) { - NCRConfig.getEncryption().toggleEncryption(); - ((EncryptionButton)btn).xTexStart = NCRConfig.getEncryption().isEnabledAndValid() ? 0 : 20; - } else { - ((EncryptionButton)btn).openEncryptionConfig(); - } - }, Component.empty(), this); - button.setTooltip(new AdvancedTooltip(() -> { - if (NCRConfig.getEncryption().isValid()) - return Component.translatable("gui.nochatreports.encryption_tooltip", Language.getInstance() - .getOrDefault("gui.nochatreports.encryption_state_" + (NCRConfig.getEncryption() - .isEnabledAndValid() ? "on" : "off"))); - else - return Component.translatable("gui.nochatreports.encryption_tooltip_invalid", Language.getInstance() - .getOrDefault("gui.nochatreports.encryption_state_" + (NCRConfig.getEncryption() - .isEnabledAndValid() ? "on" : "off"))); - }).setMaxWidth(250)); - button.active = true; - button.visible = true; - - this.addRenderableWidget(button); } @Inject(method = "tick", at = @At("RETURN")) diff --git a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinGuiMessageTagIcon.java b/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinGuiMessageTagIcon.java deleted file mode 100644 index 2f6e656..0000000 --- a/src/main/java/com/aizistral/nochatreports/common/mixins/client/MixinGuiMessageTagIcon.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.aizistral.nochatreports.common.mixins.client; - -import java.util.Arrays; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.gen.Invoker; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; - -import net.minecraft.client.GuiMessageTag; -import net.minecraft.client.GuiMessageTag.Icon; -import net.minecraft.client.gui.GuiComponent; -import net.minecraft.resources.ResourceLocation; - -@Mixin(GuiMessageTag.Icon.class) -public abstract class MixinGuiMessageTagIcon { - private static final ResourceLocation TEXTURE_NCR = new ResourceLocation("nochatreports", "textures/gui/encrypted_tag.png"); - @Shadow(aliases = "field_39768") @Mutable static Icon[] $VALUES; - - @Invoker("<init>") - static Icon create(String name, int ordinal, int u, int v, int width, int height) { - throw new IllegalStateException("Invoker transformation failed"); - } - - @Inject(method = "draw", at = @At("HEAD"), cancellable = true) - public void onDraw(PoseStack stack, int x, int y, CallbackInfo info) { - if (((Icon)(Object)this).name().equals("CHAT_NCR_ENCRYPTED")) { - RenderSystem.setShaderTexture(0, TEXTURE_NCR); - GuiComponent.blit(stack, x, y, 0, 0, 9, 9, 9, 9); - info.cancel(); - } - } - - static { - var ordinal = $VALUES.length; - var values = Arrays.copyOf($VALUES, ordinal + 1); - values[ordinal] = create("CHAT_NCR_ENCRYPTED", ordinal, 9, 0, 9, 9); - $VALUES = values; - } - -} diff --git a/src/main/resources/assets/nochatreports/lang/en_us.json b/src/main/resources/assets/nochatreports/lang/en_us.json index e91154e..208f225 100644 --- a/src/main/resources/assets/nochatreports/lang/en_us.json +++ b/src/main/resources/assets/nochatreports/lang/en_us.json @@ -23,34 +23,7 @@ "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nDisable or enable most of the mod's client-sided functionality. You may have to do this to join some Paper/Velocity servers, as they are known for causing issues with NCR.\nCertain networking-unrelated things, such as encryption, chat trust status tweaks and removal of vanilla's \"Chat messages can't be verified\" toast will still work; they can be disabled in config individually.", "gui.nochatreports.ncr_state_on": "§a§lEnabled§r", "gui.nochatreports.ncr_state_off": "§c§lDisabled§r", - "tag.nochatreports.encrypted": "Encrypted using: %1$s", - "tag.nochatreports.encrypted_original": "Non-decrypted: %1$s", - "gui.nochatreports.encryption_tooltip": "§lEncryption:§r %1$s\nRight-click to configure.\n\nWhile encryption is enabled, you can prevent it from being applied to the message by holding §n§lCtrl§r when sending it.", - "gui.nochatreports.encryption_tooltip_invalid": "§lEncryption:§r %1$s\n§cInvalid configuration. Click to configure.", - "gui.nochatreports.encryption_state_on": "§a§lEnabled§r", - "gui.nochatreports.encryption_state_off": "§c§lDisabled§r", - "gui.nochatreports.encryption_warning.header": "About Encryption", - "gui.nochatreports.encryption_warning.contents": "You can encrypt your messages using a secret key. Only people who know this key will be able to decrypt them. No Chat Reports will automatically decrypt all encrypted messages when suitable key is provided and feature is enabled.\nHowever, be aware that encryption is not a \"magic wand\" kind of solution. Moderators on third-party servers can mute or ban you for sending what will appear to them as garbled mess in chat. Futhermore, it is recommended that you generate custom encryption key, and communicate it to other people only via secure channels. Click \"Learn More\" to learn more about how and when you should use encryption.", - "gui.nochatreports.encryption_warning.check": "Don't show again", "gui.nochatreports.encryption_warning.learn_more": "Learn More", - "gui.nochatreports.encryption_config.header": "Encryption Settings", - "gui.nochatreports.encryption_config.key_desc": "§lEncryption Key§r\nKey that will be used to encrypt and decrypt your messages. It's format depends on algorithm; for AES it will be 128 bits of Base64-encoded binary data.", - "gui.nochatreports.encryption_config.passphrase_desc": "§lEncryption Passphrase§r\nInstead of generating random key, you can derive one from passphrase of your choice. If you use this - choose a strong one. Not all algorithms support passphrases.", - "gui.nochatreports.encryption_config.validation_ok": "Key Validation: §a§lPassed", - "gui.nochatreports.encryption_config.validation_failed": "Key Validation: §c§lFailed", - "gui.nochatreports.encryption_config.dice_tooltip": "Generate new random key with respect to selected encryption algorithm.", - "gui.nochatreports.encryption_config.pass_not_allowed": "<not supported>", - "gui.nochatreports.encryption_config.algorithm": "Algorithm: %1$s", - "gui.nochatreports.encryption_config.default_key": "<default: %1$s>", - "gui.nochatreports.encryption_config.encrypt_public": "Encrypt public messages", - "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R", - "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nStandard symmetric encryption algorithm. Uses 128 bit keys, output is encoded in special version of Base64 to permit transfer via Minecraft's chat. As a downside - messages will gain roughly 30% increase in length, and server might truncate them if they exceed size limit.", - "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R", - "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nMore security in exchange for severe increase in message size (12 bytes for initialization vector and 12 for authentication tag, Base64 encoding on top). Choose if you value security over anything else.", - "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R", - "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nConsiderably less secure than CFB mode, but saves you some bytes by not requiring initialization vector. Still beats Caesar.", - "algorithm.nochatreports.caesar.name": "Caesar", - "algorithm.nochatreports.caesar": "§lCaesar§r\nMeme cipher. With this you're basically hoping that people will give up without even trying to decrypt your messages. That might be true in many cases, so viability of using it depends on your threat model.\nKey should be integer from 1 to 1024. Shift is done by character code instead of alphabetically, to ensure compatibility with any language.", "nochatreports.connect.nokey_rejected": "Server rejected connection without chat signing key.", "nochatreports.connect.await": "Awaiting reconnection: %1$s seconds...", "gui.nochatreports.realms_warning.header": "Caution: Realms", @@ -92,11 +65,6 @@ "option.NoChatReports.verifiedIconOffsetX.tooltip": "Defines X-axis offset for rendering of \"Safe Server\" icon.", "option.NoChatReports.verifiedIconOffsetY": "Verified icon Y-offset", "option.NoChatReports.verifiedIconOffsetY.tooltip": "Defines Y-axis offset for rendering of \"Safe Server\" icon.", - "gui.NoChatReports.showEncryptionButtonWarning": "§cBelow does not disable encryption, it only hides the button!", - "option.NoChatReports.showEncryptionButton": "Show encryption button", - "option.NoChatReports.showEncryptionButton.tooltip": "Setting this to false will simply prevent encryption button from being displayed in the chat screen. Be aware that encryption itself will not be automatically disabled along with the button.", - "option.NoChatReports.showEncryptionIndicators": "Show encryption indicators", - "option.NoChatReports.showEncryptionIndicators.tooltip": "Toggles the display of the encrypted message indicators, in the form of a purple bar to the left and §5§l(§r§5ȯ§5§l)§r on hover to the right of the chat message.", "option.NoChatReports.showServerSafety": "Show server safety", "option.NoChatReports.showServerSafety.tooltip": "Allows the client to display server safety status in bottom-right corner of chat screen. The icon is hoverable for additional information.", "option.NoChatReports.showServerSafety.moreInfo": "§bClick here to read more about server safety levels", diff --git a/src/main/resources/assets/nochatreports/lang/et_ee.json b/src/main/resources/assets/nochatreports/lang/et_ee.json index 70b8614..3ec737e 100644 --- a/src/main/resources/assets/nochatreports/lang/et_ee.json +++ b/src/main/resources/assets/nochatreports/lang/et_ee.json @@ -23,34 +23,7 @@ "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nKeela või luba enamus modi kliendipoolsest funktsionaalsusest. See võib olla vajalik teatud Paper/Velocity serveritega ühendumiseks, kuna need on teadaolevalt NCRiga probleeme põhjustanud.\nTeatud võrguga mitteseonduvad asjad, nagu serveri turvataseme kuvamine ning vanilli \"Vestlussõnumeid ei saa kinnitada\" hüpiku eemaldus töötavad siiski; neid saab seadistustes individuaalselt lülitada.", "gui.nochatreports.ncr_state_on": "§a§llubatud§r", "gui.nochatreports.ncr_state_off": "§c§lkeelatud§r", - "tag.nochatreports.encrypted": "Krüpteeritud algoritmiga: %1$s", - "tag.nochatreports.encrypted_original": "Mitte-dekrüpteeritud: %1$s", - "gui.nochatreports.encryption_tooltip": "§lKrüpteering:§r %1$s\nSeadistamiseks paremklõpsa.\n\nKrüpteeringu lubamisel saad sa selle rakendamist ajutiselt vältida, hoides sõnumi saatmise ajal klahvi §n§lCtrl§r all.", - "gui.nochatreports.encryption_tooltip_invalid": "§lKrüpteering:§r %1$s\n§cSobimatu seadistus. Seadistamiseks klõpsa.", - "gui.nochatreports.encryption_state_on": "§a§llubatud§r", - "gui.nochatreports.encryption_state_off": "§c§lkeelatud§r", - "gui.nochatreports.encryption_warning.header": "Krüpteeringust", - "gui.nochatreports.encryption_warning.contents": "Sa saad salajase võtme abil oma sõnumeid krüpteerida. Ainult need inimesed, kes seda võtit teavad, saavad neid dekrüpteerida. No Chat Reports dekrüpteerib automaatselt kõik krüpteeritud sõnumid, kui funktsioon on lubatud ning antud on vastav võti.\nOle siiski teadlik, et krüpteerimine ei ole mingi \"võlulahendus\". Kolmanda osapoole serverite moderaatorid võivad sind vaigistada või blokeerida, kui sa saadad vestlussõnumeid, mis neile tunduvad kui segapuder. Lisaks sellele on soovitatav luua kohandatud krüpteerimisvõti ja edastada see teistele inimestele ainult turvaliste kanalite kaudu. Klõpsa \"Lisateave\", et saada rohkem teavet selle kohta, kuidas ja millal peaksid krüpteerimist kasutama.", - "gui.nochatreports.encryption_warning.check": "Ära kuva uuesti", "gui.nochatreports.encryption_warning.learn_more": "Lisateave", - "gui.nochatreports.encryption_config.header": "Krüpteeringu seaded", - "gui.nochatreports.encryption_config.key_desc": "§lKrüpteerimisvõti§r\nVõti, mida kasutatakse sinu sõnumite krüpteerimiseks ja dekrüpteerimiseks. Selle vorming sõltub algoritmist; AES puhul on see 128 bitti Base64-kodeeritud binaarandmeid.", - "gui.nochatreports.encryption_config.passphrase_desc": "§lKrüpteeringu paroolfraas§r\nJuhusliku võtme genereerimise asemel saad selle tuletada oma valitud paroolist. Seda kasutades veendu paroolfraasi tugevuses. Kõik algoritmid ei toeta paroolfraase.", - "gui.nochatreports.encryption_config.validation_ok": "Võtmekinnitus: §a§lläbitud", - "gui.nochatreports.encryption_config.validation_failed": "Võtmekinnitus: §c§lebaõnnestus", - "gui.nochatreports.encryption_config.dice_tooltip": "Genereeri uus juhuslik võti genereerimine valitud krüpteerimisalgoritmiga.", - "gui.nochatreports.encryption_config.pass_not_allowed": "<pole toetatud>", - "gui.nochatreports.encryption_config.algorithm": "Algoritm: %1$s", - "gui.nochatreports.encryption_config.default_key": "<vaikimisi: %1$s>", - "gui.nochatreports.encryption_config.encrypt_public": "Krüpteeri avalikud sõnumid", - "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R", - "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nStandardne sümmeetriline krüpteerimisalgoritm. Kasutab 128-bitiseid võtmeid, väljund on Base64-kodeeritud, et võimaldada edastamist Minecrafti vestluse kaudu. Miinusena - sõnumite pikkus suureneb umbes 30% ja server võib neid kärpida, kui need ületavad suuruspiirangut.", - "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R", - "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nSuurem turvalisus vastukaaluks sõnumi suuruse tõsisele suurenemisele (12 baiti initsialiseerimisvektorile ja 12 baiti autentimissildile, lisaks Base64-kodeering). Vali, kui sulle on turvalisus tähtsam kui miski muu.", - "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R", - "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nOluliselt vähem turvaline kui CFB-režiim, kuid säästab mõned baidid, kuna ei nõua initsialiseerimisvektorit. Siiski on see parem kui Caesar.", - "algorithm.nochatreports.caesar.name": "Caesar", - "algorithm.nochatreports.caesar": "§lCaesar§r\nNaljašiffer. Sellega põhimõtteliselt loodad, et inimesed ei üritagi sinu sõnumeid dekrüpteerida. See võib paljudel juhtudel tõsi olla, seega sõltub selle kasutamise otstarbekus sinu ohumudelist.\nVõti peaks olema täisarv vahemikus 1-1024. Nihutamine toimub tähestiku asemel tähemärkide kaupa, et tagada ühilduvus mistahes keelega.", "nochatreports.connect.nokey_rejected": "Server lükkas vestluse signeerimise võtmeta ühenduse tagasi.", "nochatreports.connect.await": "Taasühendamise ootamine: %1$s sekundit...", "gui.nochatreports.realms_warning.header": "Hoiatus: Realms", @@ -92,11 +65,6 @@ "option.NoChatReports.verifiedIconOffsetX.tooltip": "Määrab \"turvalise serveri\" ikooni renderdamise X-nihke.", "option.NoChatReports.verifiedIconOffsetY": "Kinnitatuse ikooni Y-nihe", "option.NoChatReports.verifiedIconOffsetY.tooltip": "Määrab \"turvalise serveri\" ikooni renderdamise Y-nihke.", - "gui.NoChatReports.showEncryptionButtonWarning": "§cAllolev ei keela krüpteerimist, see vaid peidab nupu!", - "option.NoChatReports.showEncryptionButton": "Kuva krüpteerimisnupp", - "option.NoChatReports.showEncryptionButton.tooltip": "Selle keelamisel peidetakse vaid vestluskuvalt vaid krüpteerimisnupp. Pane tähele, et krüpteerimist ennast ei keelata automaatselt koos nupuga.", - "option.NoChatReports.showEncryptionIndicators": "Kuva krüpteerimise indikaatorid", - "option.NoChatReports.showEncryptionIndicators.tooltip": "Lülitab krüpteeritud sõnumite indikaatorite kuvamist vasakpoolse lilla riba ning hõljumisel parempoolse §5§l(§r§5ȯ§5§l)§r ikoonina vestlussõnumi kõrval.", "option.NoChatReports.showServerSafety": "Kuva serveri turvatase", "option.NoChatReports.showServerSafety.tooltip": "Lubab mängul kuvada serveri turvataset vestluskuva paremal all nurgas. Kursoriga ikooni juurde liikudes kuvatakse täpsem kirjeldus.", "option.NoChatReports.showServerSafety.moreInfo": "§bKlõpsa siia, et lugeda serveri turvatasemete kohta", diff --git a/src/main/resources/assets/nochatreports/lang/fi_fi.json b/src/main/resources/assets/nochatreports/lang/fi_fi.json index 5ced9e2..a16f83e 100644 --- a/src/main/resources/assets/nochatreports/lang/fi_fi.json +++ b/src/main/resources/assets/nochatreports/lang/fi_fi.json @@ -31,29 +31,8 @@ "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports§r %1$s\nLaita suurin osa modin asiakasohjelman puoleisesta toiminnallisuudesta käyttöön tai pois käytöstä. Saatat joutua tekemään tämän liittyäksesi joillekin Paper- tai Velocity-palvelimille, sillä niiden tiedetään aiheuttavan ongelmia NCR:n kanssa.\nJotkin verkkotyöskentelyyn liittymättömät asiat, kuten salaus, keskustelun luotettavuustilan muokkaukset sekä \"Keskusteluviestejä ei voida todentaa\"-ilmoituksen poistaminen toimivat silti; ne voidaan laittaa pois määrityksistä yksitellen.", "gui.nochatreports.ncr_state_on": "§a§lKäytössä§r", "gui.nochatreports.ncr_state_off": "§c§lPois käytöstä§r", - "tag.nochatreports.encrypted": "Salattu käyttämällä: %1$s", - "tag.nochatreports.encrypted_original": "Salaamaton: %1$s", - "gui.nochatreports.encryption_tooltip": "§lSalaus:§r %1$s\nOikeaklikkaa määrittääksesi\n\nSalauksen ollessä käytössä, voit välttää salauksen käytön pitämällä §n§lCtrl§r-näppäintä pohjassa viestiä lähettäessäsi.", - "gui.nochatreports.encryption_tooltip_invalid": "Salaus:§r %1$s\n§cKelvottomat määritykset. Klikkaa muuttaaksesi määrityksiä.", - "gui.nochatreports.encryption_state_on": "§a§lKäytössä§r", - "gui.nochatreports.encryption_state_off": "§c§lPois käytöstä§r", - "gui.nochatreports.encryption_warning.header": "Tietoa salaamisesta", - "gui.nochatreports.encryption_warning.contents": "Voit salata viestisi käyttämällä salaista avainta. Vain he, jotka tietävät tämän avaimen, voivat purkaa salauksen. No Chat Reports purkaa salauksen kaikista viesteistä, kun sopiva avain annetaan ja ominaisuus on käytössä.\nHuomaa kuitenkin, että salaus ei ole taianomainen ratkaisu. Ulkopuolisille pelaajille salatut viestit näyttävät vain sekavalta sotkulta keskustelussa ja kolmannen osapuolen palvelimen valvojat voivat mykistää sinut tai antaa sinulle porttikiellon nähdessään viestisi. Suositellaan, että luot oman salausavaimen ja viestit toisille ihmisille vain turvallisilla kanavilla. Klikkaa \"Lue lisää\" saadaksesi lisätietoa siitä, miten ja milloin sinun pitäisi käyttää salaustoimintoa.", - "gui.nochatreports.encryption_warning.check": "Älä näytä tätä uudelleen", "gui.nochatreports.encryption_warning.learn_more": "Lue lisää", - "gui.nochatreports.encryption_config.header": "Salaamisen asetukset", - "gui.nochatreports.encryption_config.key_desc": "§lSalausavain§r\nAvain, jota käytetään viestiesi salaukseen ja salauksen purkuun. Sen muoto riippuu algoritmista: AES:llä se on 128 bittiä Base64-koodattua binääridataa.", - "gui.nochatreports.encryption_config.passphrase_desc": "§lSalauksen tunnuslause§r\nSatunnaisen avaimen luomisen sijaan voit muodostaa sellaisen haluamastasi tunnuslauseesta. Jos käytät tätä – valitse vahva tunnuslause. Kaikki algoritmit eivät toimi tunnuslauseen kanssa.", - "gui.nochatreports.encryption_config.validation_ok": "Avaimen vahvistaminen: §a§lOnnistui", - "gui.nochatreports.encryption_config.validation_failed": "Avaimen vahvistaminen: §c§lEpäonnistui", - "gui.nochatreports.encryption_config.dice_tooltip": "Luo uusi satunnainen avain, joka on yhteensopiva valitun salausalgoritmin kanssa.", - "gui.nochatreports.encryption_config.pass_not_allowed": "<ei tuettu>", - "gui.nochatreports.encryption_config.algorithm": "Algoritmi: %1$s", - "gui.nochatreports.encryption_config.default_key": "<oletus: %1$s>", - "gui.nochatreports.encryption_config.encrypt_public": "Salaa julkiset viestit", - "algorithm.nochatreports.caesar.name": "Caesarin salakirjoitus", - "algorithm.nochatreports.caesar": "§lCaesar§r\nMeemisalakirjoitus: käyttäessäsi tätä periaatteessa toivot ihmisten luovuttavan yrittämättä edes purkaa viestiesi salausta. Se voi olla totta monessa tapauksessa, joten tämän käyttökelpoisuus riippuu uhkakuvistasi.\nJoka merkille on luku välillä 1–1024. Kirjoittamasi merkki korvataan toisella merkillä tämän lukujärjestelmän avulla. Numerointia käytetään, koska aakkosjärjestys ei toimisi kaikkien kielien kanssa.", "nochatreports.connect.nokey_rejected": "Palvelin kieltäytyi yhteydestä ilman keskustelun sähköistä allekirjoitusavainta.", "nochatreports.connect.await": "Odotetaan uudelleenyhdistämistä: %1$s s...", "gui.nochatreports.realms_warning.header": "Varoitus: Realms", @@ -96,11 +75,6 @@ "option.NoChatReports.verifiedIconOffsetX.tooltip": "Määrittelee \"Turvallinen palvelin\" -kuvakkeen siirron X-akselilla.", "option.NoChatReports.verifiedIconOffsetY": "Vahvistuskuvakkeen siirto Y-akselilla", "option.NoChatReports.verifiedIconOffsetY.tooltip": "Määrittelee \"Turvallinen palvelin\" -kuvakkeen siirron Y-akselilla.", - "gui.NoChatReports.showEncryptionButtonWarning": "§cEi poista salausta käytöstä, ainoastaan piilottaa napin!", - "option.NoChatReports.showEncryptionButton": "Näytä salauspainike", - "option.NoChatReports.showEncryptionButton.tooltip": "Tämän pois käytöstä laittaminen yksinkertaisesti piilottaa salauspainikkeen keskusteluikkunasta. Huomaa, että salaus itsessään voi jäädä päälle, vaikka nappi piilotettaisiin.", - "option.NoChatReports.showEncryptionIndicators": "Näytä salausta symboloivat merkit", - "option.NoChatReports.showEncryptionIndicators.tooltip": "Laittaa salausta symboloivat merkit (purppuran palkin viestin vasemmalla puolelta ja §5§l(§r§5ȯ§5§l)§r)-merkin oikealta) näkyviin tai piiloon.", "option.NoChatReports.showServerSafety": "Näytä palvelimen turvallisuus", "option.NoChatReports.showServerSafety.tooltip": "Asiakasohjelma näyttää palvelimen turvallisuustilan keskusteluikkunan oikeassa alanurkassa. Osoittimen vieminen kuvakkeen päälle näyttää lisätietoja.", "option.NoChatReports.showServerSafety.moreInfo": "§bKlikkaa tästä lukeaksesi lisää palvelimen turvallisuustasoista.", diff --git a/src/main/resources/assets/nochatreports/lang/ko_kr.json b/src/main/resources/assets/nochatreports/lang/ko_kr.json index 0b9156c..bd51cb9 100644 --- a/src/main/resources/assets/nochatreports/lang/ko_kr.json +++ b/src/main/resources/assets/nochatreports/lang/ko_kr.json @@ -16,30 +16,7 @@ "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\n모드의 대부분의 클라이언트 기능들을 활성화하거나 비활성화합니다. No Chat Reports와 문제를 일으키는 것으로 알려진 일부 Paper/Velocity 서버에 접속하기 위해 모드를 비활성화해야할 수 있습니다.\n암호화, 대화 신뢰 상태 조정 및 바닐라의 \"대화 메세지가 검증될 수 없습니다.\" 알림 제거 등 네트워킹과 관련이 없는 일부 기능은 작동하며 모드 설정에서 개별적으로 비활성화할 수 있습니다.", "gui.nochatreports.ncr_state_on": "§a§l활성화됨§r", "gui.nochatreports.ncr_state_off": "§c§l비활성화됨§r", - "tag.nochatreports.encrypted": "다음을 사용하여 암호화: %1$s", - "tag.nochatreports.encrypted_original": "암호화하지 않음: %1$s", - "gui.nochatreports.encryption_tooltip": "§l암호화:§r %1$s\n오른쪽 클릭하여 설정.", - "gui.nochatreports.encryption_tooltip_invalid": "§lEncryption:§r %1$s\n§c잘못된 설정입니다. 오른쪽 클릭하여 설정.", - "gui.nochatreports.encryption_state_on": "§a§l활성화됨§r", - "gui.nochatreports.encryption_state_off": "§c§l비활성화됨§r", - "gui.nochatreports.encryption_warning.header": "암호화에 대하여", - "gui.nochatreports.encryption_warning.contents": "키를 사용하여 메시지를 암호화합니다. 이 키를 아는 사람들만 메시지를 복호화할 수 있습니다. No Chat Reports는 적절한 키가 제공되고 기능이 활성화된 경우 모든 암호화된 메시지를 자동으로 복호화합니다.\n그러나 암호화는 \"마법 지팡이\" 해결책이 아닙니다. 제 3자 서버의 관리자들은 그들에게 알아들을 수 없는 스팸처럼 보이는 대화를 보내는 것에 대해 당신을 서버에서 음소거하거나 차단할 수 있습니다. 또한, 사용자 지정 암호화 키를 생성하고 보안 채널만 사용하여 소통하는 것이 추천됩니다. 암호화를 언제 어떻게 사용해야 하는지 알아보려면 \"더 알아보기\"를 클릭하세요.", - "gui.nochatreports.encryption_warning.check": "다시 표시하지 않기", "gui.nochatreports.encryption_warning.learn_more": "더 알아보기", - "gui.nochatreports.encryption_config.header": "암호화 설정", - "gui.nochatreports.encryption_config.key_desc": "§l암호화 키§r\n메시지를 암호화하고 복호화하는데 사용할 키입니다. 이것의 형식은 알고리즘에 따라 다릅니다. AES의 경우 128비트의 Base64로 인코딩된 이진 데이터입니다.", - "gui.nochatreports.encryption_config.passphrase_desc": "§l암호화 비밀구절§r\n임의의 키를 생성하지 않고 비밀구절 중에서 하나를 사용할 수 있습니다. 이것을 사용한다면 강력한 것을 고르세요. 모든 알고리즘이 비밀구절을 지원하는 것은 아닙니다.", - "gui.nochatreports.encryption_config.validation_ok": "키 검증: §a§l성공", - "gui.nochatreports.encryption_config.validation_failed": "키 검증: §c§l실패", - "gui.nochatreports.encryption_config.dice_tooltip": "선택한 알고리즘에 따라 새로운 임의의 키를 생성합니다.", - "gui.nochatreports.encryption_config.pass_not_allowed": "<지원되지 않음>", - "gui.nochatreports.encryption_config.algorithm": "알고리즘: %1$s", - "gui.nochatreports.encryption_config.default_key": "<기본: %1$s>", - "gui.nochatreports.encryption_config.encrypt_public": "공개 메시지 암호화", - "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\n표준 대칭 암호화 알고리즘. 128비트 키를 사용하며, 출력은 Minecraft의 대화로 전송될 수 있도록 Base64로 인코딩됩니다. 메시지가 약 30% 길어지고 길이 제한을 초과하면 서버가 메시지를 자를 수 있습니다.", - "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\n더 안전하지만 메시지가 더 길어집니다 (초기화 벡터에 12바이트, 인증 태그에 12바이트, Base64 인코딩). 보안을 무엇보다 중요하게 여긴다면 사용하십시오.", - "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nCFB 모드보다 훨씬 덜 안전하지만 초기화 벡터가 필요하지 않아 몇 바이트를 절약할 수 있습니다. 여전히 카이사르 암호보다 낫습니다.", - "algorithm.nochatreports.caesar": "§l카이사르 암호§r\n밈 암호. 사람들이 메시지를 해독하려 시도하지도 않고 포기하길 바랍니다. 이는 실제로 많은 상황에서 사실일 수 있으므로 사용할 수 있을지는 당신의 위협 모델에 따라 다릅니다.\n키는 1과 1024 사이의 정수여야 하며 시프트는 모든 언어와의 호환성을 보장하기 위해 알파벳이 아닌 문자 코드를 기준으로 합니다.", "configuration.NoChatReports.config": "No Chat Reports", diff --git a/src/main/resources/assets/nochatreports/lang/pl_pl.json b/src/main/resources/assets/nochatreports/lang/pl_pl.json index 4afc9d8..3dfbb1e 100644 --- a/src/main/resources/assets/nochatreports/lang/pl_pl.json +++ b/src/main/resources/assets/nochatreports/lang/pl_pl.json @@ -24,34 +24,7 @@ "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nWyłącz lub włącz większość funkcji po stronie klienta moda. Być może będziesz musiał to zrobić, aby dołączyć do niektórych serwerów Paper/Velocity, ponieważ są one znane z powodowania problemów z NCR.\nNiektóre rzeczy niezwiązane z siecią, takie jak szyfrowanie, poprawianie stanu zaufania czatu i usuwane z vanilii \"Wiadomości na czacie nie mogą być zweryfikowane\" toasty nadal będą działać; można je wyłączyć w konfiguracji indywidualnie.", "gui.nochatreports.ncr_state_on": "§a§lWłączony§r", "gui.nochatreports.ncr_state_off": "§c§lWyłączony§r", - "tag.nochatreports.encrypted": "Zaszyfrowany używając: %1$s", - "tag.nochatreports.encrypted_original": "Nieodszyfrowane: %1$s", - "gui.nochatreports.encryption_tooltip": "§lSzyfrowanie:§r %1$s\nKliknij prawym przyciskiem, aby skonfigurować.\n\nGdy szyfrowanie jest włączone, możesz zapobiec jego zastosowaniu do wiadomości, przytrzymując §n§lCtrl§r podczas wysyłania.", - "gui.nochatreports.encryption_tooltip_invalid": "§lSzyfrowanie:§r %1$s\n§cNie prawidłowa konfiguracja. Kliknij, aby skonfigurować.", - "gui.nochatreports.encryption_state_on": "§a§lWłączone§r", - "gui.nochatreports.encryption_state_off": "§c§lWyłączone§r", - "gui.nochatreports.encryption_warning.header": "O Szyfrowaniu", - "gui.nochatreports.encryption_warning.contents": "Możesz zaszyfrować swoje wiadomości za pomocą tajnego klucza. Tylko osoby znające ten klucz będą mogły je odszyfrować. No Chat Reports automatycznie odszyfruje wszystkie zaszyfrowane wiadomości po podaniu odpowiedniego klucza i włączeniu funkcji.\nJednakże należy pamiętać, że szyfrowanie nie jest rozwiązaniem typu \"magicznej różdżki\". Moderatorzy na serwerach stron trzecich mogą wyciszyć lub zablokować Cię za wysyłanie tego, co będzie im się wydawać zniekształconym bałaganem na czacie. Ponadto zaleca się wygenerowanie niestandardowego klucza szyfrowania i przekazywanie go innym osobom wyłącznie za pośrednictwem bezpiecznych kanałów. Kliknij \"Więcej informacji\", aby dowiedzieć się więcej o tym, jak i kiedy należy używać szyfrowania.", - "gui.nochatreports.encryption_warning.check": "Nie pokazuj ponownie", "gui.nochatreports.encryption_warning.learn_more": "Dowiedz się więcej", - "gui.nochatreports.encryption_config.header": "Ustawienia Szyfrowania", - "gui.nochatreports.encryption_config.key_desc": "§lKlucz szyfrowania§r\nKlucz, który będzie używany do szyfrowania i odszyfrowywania wiadomości. Jego format zależy od algorytmu; dla AES będzie to 128 bitów danych binarnych zakodowanych w Base64.", - "gui.nochatreports.encryption_config.passphrase_desc": "§lHasło szyfrowania§r\nZamiast generować losowy klucz, możesz go wyprowadzić z wybranego hasła. Jeśli używasz tego - wybierz mocny. Nie wszystkie algorytmy obsługują hasła.", - "gui.nochatreports.encryption_config.validation_ok": "Walidacja klucza: §a§lPomyślna", - "gui.nochatreports.encryption_config.validation_failed": "Walidacja klucza: §c§lBłąd", - "gui.nochatreports.encryption_config.dice_tooltip": "Wygeneruj nowy losowy klucz z uwzględnieniem wybranego algorytmu szyfrowania.", - "gui.nochatreports.encryption_config.pass_not_allowed": "<nieobsługiwane>", - "gui.nochatreports.encryption_config.algorithm": "Algorytm: %1$s", - "gui.nochatreports.encryption_config.default_key": "<domyślny: %1$s>", - "gui.nochatreports.encryption_config.encrypt_public": "Szyfruj wiadomości publiczne", - "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R", - "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nStandardowy algorytm szyfrowania symetrycznego. Używa 128-bitowych kluczy, dane wyjściowe są zakodowane w Base64, aby umożliwić przesyłanie za pośrednictwem czatu Minecrafta. Wadą - wiadomości zyskają około 30% długości, a serwer może je skrócić, jeśli przekroczą limit rozmiaru.", - "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R", - "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nWiększe bezpieczeństwo w zamian za znaczny wzrost rozmiaru wiadomości (12 bajtów na wektor inicjujący i 12 na znacznik uwierzytelniania, kodowanie Base64 na górze). Wybierz, jeśli cenisz bezpieczeństwo ponad wszystko inne.", - "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R", - "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nZnacznie mniej bezpieczny niż tryb CFB, ale oszczędza kilka bajtów, ponieważ nie wymaga wektora inicjalizacji. Wciąż lepsze od Cezara.", - "algorithm.nochatreports.caesar.name": "Cazar", - "algorithm.nochatreports.caesar": "§lCezar§r\nSzyfr dla memu. Dzięki temu masz zasadniczo nadzieję, że ludzie zrezygnują, nawet nie próbując odszyfrować twoich wiadomości. Może to być prawdą w wielu przypadkach, więc opłacalność jego użycia zależy od modelu zagrożenia.\nKlucz powinien być liczbą całkowitą od 1 do 1024. Przesunięcie odbywa się za pomocą kodu znakowego, a nie alfabetycznego, aby zapewnić zgodność z dowolnym językiem.", "nochatreports.connect.nokey_rejected": "Serwer odrzucił połączenie bez klucza podpisywania czatu.", "nochatreports.connect.await": "Oczekiwanie na ponowne połączenie: %1$s sekund...", "gui.nochatreports.realms_warning.header": "Uwaga: Realms", @@ -112,8 +85,6 @@ "option.NoChatReports.signingCheckDelaySeconds.tooltip": "Opóźnienie w sekundach na sprawdzenie, czy serwery na białej liście nadal wymagają podpisów czatu. Ustawienie na 0 spowoduje sprawdzanie przy każdej próbie logowania, podobnie jak przy serwerach nie na białej liście.", "option.NoChatReports.serverSigningChecks": "Kontrole podpisywania serwera", "option.NoChatReports.serverSigningChecks.tooltip": "Mapa serwerów z białej listy do czasów sprawdzania wymuszania ostatniego podpisywania, w sekundach epoki. Zwykle nie trzeba tego edytować ręcznie.", - "option.NoChatReports.showEncryptionButton": "Pokaż przycisk szyfrowania", - "option.NoChatReports.showEncryptionButton.tooltip": "Ustawienie tego na false po prostu uniemożliwi wyświetlanie przycisku szyfrowania na ekranie czatu. Należy pamiętać, że samo szyfrowanie nie zostanie automatycznie wyłączone wraz z przyciskiem.", "configuration.NoChatReports.category.whitelistedServers": "Serwery w białej liście", "option.NoChatReports.whitelistedServers": "Serwery w białej liście", "option.NoChatReports.whitelistedServers.tooltip": "Zawiera serwery, dla których ekran ostrzeżenia \"Żądane podpisy czatu\" nie powinien nigdy być wyświetlany. Serwery są dodawane do tej listy po kliknięciu \"Dodaj serwer do Białej listy\" na tym ekranie.\nKażdy wpis jest ciągiem znaków w formacie §l<adres-serwera>:<port>§r.", @@ -127,6 +98,5 @@ "option.NoChatReports.convertToGameMessage": "Konwertuj na wiadomość z gry", "option.NoChatReports.convertToGameMessage.tooltip": "Sprawia, że serwer konwertuje wszystkie wiadomości gracza na wiadomości systemowe. Wiadomości systemowe nie mają żadnych podpisów i nie mogą być raportowane; na niezmodyfikowanych klientach będą wyświetlane z szarym paskiem po lewej stronie.", "option.NoChatReports.addQueryData": "Dodaj dane zapytania", - "option.NoChatReports.addQueryData.tooltip": "Umożliwia serwerowi wysyłanie dodatkowych danych do klienta podczas obsługi pingów. Służy do wyświetlania ikony \"Bezpieczny serwer\", a także do innych celów technicznych.", - "gui.NoChatReports.showEncryptionButtonWarning": "§cPoniższe nie wyłącza szyfrowania, tylko ukrywa przycisk!" + "option.NoChatReports.addQueryData.tooltip": "Umożliwia serwerowi wysyłanie dodatkowych danych do klienta podczas obsługi pingów. Służy do wyświetlania ikony \"Bezpieczny serwer\", a także do innych celów technicznych." } diff --git a/src/main/resources/assets/nochatreports/lang/pt_br.json b/src/main/resources/assets/nochatreports/lang/pt_br.json index 70b19cd..56f1dc1 100644 --- a/src/main/resources/assets/nochatreports/lang/pt_br.json +++ b/src/main/resources/assets/nochatreports/lang/pt_br.json @@ -18,41 +18,13 @@ "gui.nochatreports.ncr_toggle_tooltip": "§lSem relatórios de bate-papo:§r %1$s\nDesative ou habilite a maioria da funcionalidade do lado do cliente do MOD.Você pode ter que fazer isso para ingressar em alguns servidores de papel/velocidade, pois eles são conhecidos por causar problemas com a NCR.\nCerta networking-unrelated things, como criptografia, ajustes de status de confiança de bate-papo e remoção de vanilla \"As mensagens de bate-papo não podem ser verificadas\" A torrada ainda funcionará;Eles podem ser desativados na configuração individualmente.",
"gui.nochatreports.ncr_state_on": "§a§lHabilitada§r",
"gui.nochatreports.ncr_state_off": "§c§lDesabilitada§r",
- "tag.nochatreports.encrypted": "Criptografado usando: %1$s",
- "tag.nochatreports.encrypted_original": "Não concretizado: %1$s",
- "gui.nochatreports.encryption_tooltip": "§lCriptografia:§r %1$s\nClique com o botão direito do mouse para configurar.\n\nEnquanto a criptografia está ativada, você pode impedir que ela seja aplicada à mensagem segurando §n§lCtrl§r Ao enviá-lo.",
- "gui.nochatreports.encryption_tooltip_invalid": "§lEcriptografia:§r %1$s\n§cConfiguração inválida.Clique para configurar.",
- "gui.nochatreports.encryption_state_on": "§a§lHabilitada§r",
- "gui.nochatreports.encryption_state_off": "§c§lDesabilitada§r",
- "gui.nochatreports.encryption_warning.header": "Sobre criptografia",
- "gui.nochatreports.encryption_warning.contents": "Você pode criptografar suas mensagens usando uma chave secreta.Somente as pessoas que sabem que essa chave poderão descriptografá-las.Nenhum relatório de bate-papo descriptografará automaticamente todas as mensagens criptografadas quando a chave adequada for fornecida e o recurso é ativado.\nNo entanto, esteja ciente de que a criptografia não é um \"varinha mágica\" tipo de solução.Os moderadores em servidores de terceiros podem silenciar ou bani-lo por enviar o que aparecerá para eles como bagunça ilegal no bate-papo.ALÉM DISSO, é recomendável que você gere a chave de criptografia personalizada e a comunique a outras pessoas apenas por meio de canais seguros.Clique \"Saber mais\" Para saber mais sobre como e quando você deve usar a criptografia.",
- "gui.nochatreports.encryption_warning.check": "Não mostre de novo",
"gui.nochatreports.encryption_warning.learn_more": "Saber mais",
- "gui.nochatreports.encryption_config.header": "Configurações de criptografia",
- "gui.nochatreports.encryption_config.key_desc": "§lChave de encriptação§r\nChave que será usada para criptografar e descriptografar suas mensagens.Seu formato depende do algoritmo;Para o AES, serão 128 bits de dados binários codificados pela base64.",
- "gui.nochatreports.encryption_config.passphrase_desc": "§lSenha de criptografia§r\nEm vez de gerar chave aleatória, você pode derivar uma da senha de sua escolha.Se você usar isso - escolha um forte.Nem todos os algoritmos suportam as sessões.",
- "gui.nochatreports.encryption_config.validation_ok": "Validação-chave: §a§lPassou",
- "gui.nochatreports.encryption_config.validation_failed": "Validação-chave: §c§lFracassou",
- "gui.nochatreports.encryption_config.dice_tooltip": "Gerar nova chave aleatória em relação ao algoritmo de criptografia selecionado.",
- "gui.nochatreports.encryption_config.pass_not_allowed": "<não suportado>",
- "gui.nochatreports.encryption_config.algorithm": "Algoritmo: %1$s",
- "gui.nochatreports.encryption_config.default_key": "<predefinição: %1$s>",
- "gui.nochatreports.encryption_config.encrypt_public": "Criptografar mensagens públicas",
- "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R",
- "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nAlgoritmo de criptografia simétrica padrão.Usa as teclas de 128 bits, a saída é codificada na versão especial da base64 para permitir a transferência por meio do bate-papo do Minecraft.Como uma desvantagem - as mensagens ganharão um aumento de cerca de 30% no comprimento, e o servidor poderá truncá -las se exceder o limite de tamanho.",
- "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R",
- "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nMais segurança em troca de um aumento grave no tamanho da mensagem (12 bytes para vetor de inicialização e 12 para tag de autenticação, codificação base64 na parte superior).Escolha se você valoriza a segurança em vez de qualquer outra coisa.",
- "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R",
- "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nConsideravelmente menos seguro que o modo CFB, mas economiza alguns bytes por não exigir o vetor de inicialização.Ainda vence César.",
- "algorithm.nochatreports.caesar.name": "Caesar",
- "algorithm.nochatreports.caesar": "§lCaesar§r\nMeme Cipher.Com isso, você basicamente espera que as pessoas desista sem sequer tentar descriptografar suas mensagens.Isso pode ser verdade em muitos casos; portanto, a viabilidade de usá -lo depende do seu modelo de ameaça.\nA chave deve ser inteira de 1 a 1024. A mudança é feita pelo código do caractere, em vez de alfabeticamente, para garantir a compatibilidade com qualquer idioma.",
"nochatreports.connect.nokey_rejected": "Conexão rejeitada por servidor sem chave de assinatura de bate-papo.",
"nochatreports.connect.await": "Aguardando reconexão: %1$s ssegundas..",
"gui.nochatreports.realms_warning.header": "Cuidado: Realms",
"gui.nochatreports.realms_warning.contents": "Os servidores da Realms não são privados.Os proprietários de imóveis não podem desativar os relatórios de bate-papo, e Mojang aplica monitoramento adicional de bate-papo para identificar potencial \"danos online\" e escalá-los para a revisão humana.Se você for encontrado para violar os padrões da comunidade da Minecraft - mesmo que os participantes do bate-papo não se ofendessem - você será banido, temporária ou permanentemente, de todos os serviços multiplayer.O uso da criptografia é altamente recomendável.",
"gui.nochatreports.realms_warning.check": "Não mostre de novo",
"gui.nochatreports.realms_warning.learn_more": "Saber mais",
- "gui.NoChatReports.showEncryptionButtonWarning": "§cAbaixo não desative a criptografia, ela apenas esconde o botão!",
"configuration.NoChatReports.config": "Sem relatórios de bate-papo",
@@ -102,8 +74,6 @@ "option.NoChatReports.signingCheckDelaySeconds.tooltip": "Atraso para verificar se os servidores de Whitelisted ainda aplicam a assinatura do bate-papo, em segundos.Configurar isso para 0 fará com que a verificação seja executada em todas as tentativas de login, semelhantes a servidores não brancos.",
"option.NoChatReports.serverSigningChecks": "Verificações de assinatura do servidor",
"option.NoChatReports.serverSigningChecks.tooltip": "Mapa de servidores de permissões para último assinar os tempos de verificação da aplicação, em segundos de época.Isso normalmente não precisa ser editado manualmente.",
- "option.NoChatReports.showEncryptionButton": "Mostrar botão de criptografia",
- "option.NoChatReports.showEncryptionButton.tooltip": "Definir isso como false simplesmente impedirá que o botão de criptografia seja exibido na tela de bate-papo.Esteja ciente de que a própria criptografia não será desativada automaticamente junto com o botão.",
"configuration.NoChatReports.category.whitelistedServers": "Servidores de permissões na lista de permissões",
diff --git a/src/main/resources/assets/nochatreports/lang/th_th.json b/src/main/resources/assets/nochatreports/lang/th_th.json index 46bc901..85bfe22 100644 --- a/src/main/resources/assets/nochatreports/lang/th_th.json +++ b/src/main/resources/assets/nochatreports/lang/th_th.json @@ -17,34 +17,7 @@ "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nปิดหรือเปิดฟังก์ชันต่าง ๆ ของม็อดฝั่งไคลเอนต์ ซึ่งคุณอาจจำเป็นต้องเปิดหรือปิดตัวเลือกนี้เพื่อให้สามารถเข้าเล่นเซิร์ฟเวอร์ของ Paper หรือ Velocity บางเซิร์ฟเวอร์ได้, เนื่องมาจากเซิร์ฟเวอร์เหล่านี้มักมีปัญหากับม็อดนี้.\nฟีเจอร์บางอย่างที่ไม่เกี่ยวข้องกับเครือข่าย เช่น การเข้ารหัส การปรับปรุงสถานะความน่าเชื่อถือของแช็ต และการนำโทสต์ \"ไม่สามารถยืนยันข้อความแช็ตได้\" ออก จะยังคงใช้งานได้ตามปกติ ฟีเจอร์เหล่านี้สามารถปิดแยกแต่ละฟีเจอร์ได้", "gui.nochatreports.ncr_state_on": "§a§lเปิด§r", "gui.nochatreports.ncr_state_off": "§c§lปิด§r", - "tag.nochatreports.encrypted": "เข้ารหัสโดยใช้: %1$s", - "tag.nochatreports.encrypted_original": "ไม่ถอดรหัส: %1$s", - "gui.nochatreports.encryption_tooltip": "§lการเข้ารหัส:§r %1$s\nคลิกขวาเพื่อต้้งค่า", - "gui.nochatreports.encryption_tooltip_invalid": "§lการเข้ารหัส:§r %1$s\n§cการตั้งค่าไม่ถูกต้อง คลิกเพื่อตั้งค่า", - "gui.nochatreports.encryption_state_on": "§a§lเปิด§r", - "gui.nochatreports.encryption_state_off": "§c§lปิด§r", - "gui.nochatreports.encryption_warning.header": "เกี่ยวกับการเข้ารหัส", - "gui.nochatreports.encryption_warning.contents": "คุณสามารถเข้ารหัสข้อความของคุณได้โดยใช้คีย์ลับ มีเพียงคนที่รู้คีย์ดังกล่าวที่จะสามารถถอดรหัสได้ โดยตัวม็อด No Chat Reports จะถอดรหัสทุกข้อความที่เข้ารหัสมาแล้วให้เมื่อมีการป้อนคีย์ที่เหมาะสมให้และมีฟีเจอร์ดังกล่าวเปิดการใช้งานอยู่\nอย่างไรก็ตาม ก็ต้องระวังไว้ด้วยว่าการเข้ารหัสนั้นไม่ใช่ \"คฑาวิเศษ\" ที่สามารถชี้ไปทางไหนก็แก้ปัญหาได้มากขนาดนั้น ผู้ดูแลในเซิร์ฟเวอร์มือที่สามยังสามารถปิดเสียง (ไม่ให้พูดคุย) หรือแบนคุณได้อยู่จากการส่งข้อความที่พวกเขาเห็นเป็นเพียงข้อความต่างดาวที่อ่านไม่ออกในแช็ต นอกจากนี้ แนะนำว่าให้คุณสร้างคีย์เข้ารหัสขึ้นมาเอง และใช้สื่อสารมันกับคนอื่น ๆ ผ่านช่องทางที่ปลอดภัยจะเป็นการดีกว่า คลิก \"เรียนรู้เพิ่มเติม\" เพื่อเรียนรู้เพิ่มเติมว่าการเข้ารหัสต้องใช้อย่างไร และต้องใช้เมื่อไร", - "gui.nochatreports.encryption_warning.check": "ไม่ต้องแสดงอีก", "gui.nochatreports.encryption_warning.learn_more": "เรียนรู้เพิ่มเติม", - "gui.nochatreports.encryption_config.header": "การตั้งค่าการเข้ารหัส", - "gui.nochatreports.encryption_config.key_desc": "§lคีย์การเข้ารหัส§r\nเป็นคีย์ที่ใช้ในการเข้าหรือถอดรหัสข้อความของคุณเอง โดยรูปแบบของคีย์นั้นขึ้นอยู่กับวิธีการที่ใช้ หากเป็น AES ตัวคีย์จะเป็นข้อมูลตัวเลขฐานสองแบบ Base64-encoded 128 บิต", - "gui.nochatreports.encryption_config.passphrase_desc": "§ข้อความรหัสผ่านของการเข้ารหัส§r\nจะเป็นการรับรหัสจากข้อความรหัสผ่านที่คุณเลือกเอง แทนการสร้างคีย์ขึ้นมาสุ่ม ๆ ถ้าคุณใช้ตัวเลือกนี้ โปรดเลือกรหัสที่มีความแข็งแรง คาดเดาได้ยาก มีบางอัลกอริทึมที่ไม่สามารถใช้ข้อความรหัสผ่านได้", - "gui.nochatreports.encryption_config.validation_ok": "การตรวจสอบคีย์: §a§lผ่าน", - "gui.nochatreports.encryption_config.validation_failed": "การตรวจสอบคีย์: §c§lไม่ผ่าน", - "gui.nochatreports.encryption_config.dice_tooltip": "สร้างคีย์ใหม่ขึ้นมาแบบสุ่มตามอัลกอริทึมการเข้ารหัสที่ได้เลือกไว้", - "gui.nochatreports.encryption_config.pass_not_allowed": "<ไม่ได้รับการสนับสนุน>", - "gui.nochatreports.encryption_config.algorithm": "อัลกอริทึม: %1$s", - "gui.nochatreports.encryption_config.default_key": "<ค่าเริ่มต้น: %1$s>", - "gui.nochatreports.encryption_config.encrypt_public": "เข้ารหัสข้อความสาธารณะ", - "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R", - "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nอัลกอริทึมการเข้ารหัสแบบสมมาตรปกติ ใช้คีย์แบบ 128 บิต ข้อมูลส่งออกจะเป็นลักษณะการเข้ารหัสแบบ Base64 (Base64-encoded) เพื่อให้อนุญาตการถ่ายโอนข้อมูลผ่านระบบแช็ตของ Minecraft มีข้อเสียได้แก่ ข้อความจะมีความยาวมากขึ้นราว ๆ 30% และเซิร์ฟเวอร์อาจจะตัดข้อความเหล่านั้นหากมีขนาดที่มากเกินไปช", - "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R", - "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nมีความปลอดภัยมากกว่า แลกมากับขนาดของข้อความที่เพิ่มมากขึ้นเป็นจำนวนมาก (ต้องใช้พื้นที่ 12 ไบต์ สำหรับเส้นสมมติเริ่มต้น และอีก 12 ไบต์ สำหรับแท็กการรับรอง ตบท้ายด้วยการเข้ารหัสแบบ Base64) แนะนำให้เลือกตัวเลือกนี้หากคุณต้องการให้ความสำคัญกับความปลอดภัยเป็นที่หนึ่ง", - "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R", - "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nมีความปลอดภัยน้อยกว่าแบบ CFB เป็นอย่างมาก แต่ช่วยประหยัดพื้นที่ได้โดยไม่มีการสร้างเส้นสมมติเริ่มต้นขึ้นมา ยังคงดีกว่าแบบ Caesar อยู่", - "algorithm.nochatreports.caesar.name": "Caesar", - "algorithm.nochatreports.caesar": "§lCaesar§r\nตั้งตามนามของ Meme cipher. หากปรับเป็นโหมดนี้ คุณอาจหวังได้แค่ว่าคนอื่นจะยอมไม่ถอดรหัสข้อความของคุณ ซึ่งอาจจะเกิดขึ้นจริงก็ได้ในหลาย ๆ กรณี เพราะฉะนั้นการที่มันทำงานได้ดีหรือไม่นั้นขึ้นอยู่กับโมเดลแบบอย่างของผู้ไม่ประสงค์ดี\nคีย์มักจะเป็นตัวเลขจำนวนเต็มตั้งแต่ 1 ถึง 1024 การเลื่อนนั้นทำได้โดยใช้รหัสอักขระแทนตัวอักษร เพื่อให้แน่ใจว่าจะสามารถใช้งานร่วมกับภาษาอื่น ๆ ได้", "nochatreports.connect.nokey_rejected": "เซิร์ฟเวอร์ปฏิเสธการเชื่อมต่อที่ไม่มีคีย์การลงนามแช็ต", "nochatreports.connect.await": "กำลังรอการเชื่อมต่อใหม่อีกครั้ง: %1$s วินาที...", diff --git a/src/main/resources/assets/nochatreports/lang/zh_cn.json b/src/main/resources/assets/nochatreports/lang/zh_cn.json index 9b955eb..81f424b 100644 --- a/src/main/resources/assets/nochatreports/lang/zh_cn.json +++ b/src/main/resources/assets/nochatreports/lang/zh_cn.json @@ -23,34 +23,7 @@ "gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r%1$s\n禁用或启用模组的大部分客户端功能。你可能必须这样做才能加入一些Paper/Velocity服务器,因为它们会导致NCR问题。某些与网络无关的事情,如加密、聊天信任状态调整和删除原版的“聊天消息无法验证”警告弹窗仍然有效;它们可以在配置中单独禁用。", "gui.nochatreports.ncr_state_on": "§a§l启用§r", "gui.nochatreports.ncr_state_off": "§c§l禁用§r", - "tag.nochatreports.encrypted": "加密方式:%1$s", - "tag.nochatreports.encrypted_original": "无法解密消息的人看起来就像这样:%1$s", - "gui.nochatreports.encryption_tooltip": "§l加密:§r%1$s\n右击以配置。\n\n当启用加密时,你可以通过在发送消息时按住Ctrl来暂时关闭。", - "gui.nochatreports.encryption_tooltip_invalid": "§l加密:§r%1$s\n§c无效配置。单击以配置。", - "gui.nochatreports.encryption_state_on": "§a§l启用§r", - "gui.nochatreports.encryption_state_off": "§c§l禁用§r", - "gui.nochatreports.encryption_warning.header": "关于加密", - "gui.nochatreports.encryption_warning.contents": "你可以使用密钥加密消息,只有知道此密钥的人才能解密它们。当提供合适的密钥并启用该功能时,No Chat Reports将自动解密所有加密消息。\n然而,请注意,加密不是一种万能的解决方案。第三方服务器的所有者可以禁止你发送聊天中看起来乱糟糟的内容。此外,建议你生成自定义加密密钥,并仅通过安全通道将其传递给其他人。单击“了解更多”以了解有关如何以及何时使用加密的更多信息。", - "gui.nochatreports.encryption_warning.check": "不再提示", "gui.nochatreports.encryption_warning.learn_more": "了解更多", - "gui.nochatreports.encryption_config.header": "加密设置", - "gui.nochatreports.encryption_config.key_desc": "§l加密密钥§\r\n用于加密和解密消息的密钥。它的格式取决于算法;对于AES,它将是128位的Base64编码二进制数据。", - "gui.nochatreports.encryption_config.passphrase_desc": "§l加密密码短语§\r\n你可以从自己选择的密码中导出一个密钥,而不是生成随机密钥。如果你使用这个-选择一个强大的。并非所有算法都支持密码短语。", - "gui.nochatreports.encryption_config.validation_ok": "密钥检测:§a§l正常", - "gui.nochatreports.encryption_config.validation_failed": "密钥检测:§c§l失败", - "gui.nochatreports.encryption_config.dice_tooltip": "针对所选加密算法生成新的随机密钥。", - "gui.nochatreports.encryption_config.pass_not_allowed": "<不支持>", - "gui.nochatreports.encryption_config.algorithm": "算法:%1$s", - "gui.nochatreports.encryption_config.default_key": "<默认:%1$s>", - "gui.nochatreports.encryption_config.encrypt_public": "加密公共消息", - "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R", - "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\n标准对称加密算法。使用128位密钥,输出以Base64的特殊版本编码,以允许通过Minecraft的聊天进行传输。有一个缺点是,消息长度将增加大约30%,如果超过长度限制,服务器可能会截断它们。", - "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R", - "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\n更高的安全性,但是消息大小严重增加(12字节用于初始化向量,12字节用于身份验证标签,顶部为Base64编码)。是否选择取决于你是否重视安全而不是其他。", - "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R", - "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\n与CFB模式相比,安全性大大降低,但不需要初始化向量,从而节省了一些字节。仍然比Caesar安全。", - "algorithm.nochatreports.caesar.name": "Caesar", - "algorithm.nochatreports.caesar": "§lCaesar§r\n数字密码。有了这个,你基本上是希望人们会放弃,甚至不尝试解密你的消息。这在很多情况下可能是正确的,所以使用它的可行性取决于你的威胁模型。\nKey应该是从1到1024的整数。移位是按字符代码而不是按字母顺序进行的,以确保与任何语言兼容。", "nochatreports.connect.nokey_rejected": "服务器拒绝没有聊天签名密钥的连接。", "nochatreports.connect.await": "等待重连:%1$s秒……", "gui.nochatreports.realms_warning.header": "警告:Realms", @@ -92,11 +65,6 @@ "option.NoChatReports.verifiedIconOffsetX.tooltip": "定义渲染“安全服务器”图标的X轴偏移。", "option.NoChatReports.verifiedIconOffsetY": "验证图标Y轴偏移", "option.NoChatReports.verifiedIconOffsetY.tooltip": "定义渲染“安全服务器”图标的Y轴偏移。", - "gui.NoChatReports.showEncryptionButtonWarning": "§c下方选项不禁用加密,它只隐藏按钮!", - "option.NoChatReports.showEncryptionButton": "显示加密按钮", - "option.NoChatReports.showEncryptionButton.tooltip": "将此设置为否只会阻止聊天屏幕中显示加密按钮。请注意,加密本身不会随按钮一起自动禁用。", - "option.NoChatReports.showEncryptionIndicators": "显示加密指示符", - "option.NoChatReports.showEncryptionIndicators.tooltip": "切换加密消息指示符的显示,以紫色条的形式显示在聊天消息的左侧和§5§l(§r§5?§5§l)§r悬停显示在聊天消息的右侧。", "option.NoChatReports.showServerSafety": "显示服务器安全性", "option.NoChatReports.showServerSafety.tooltip": "允许客户端在聊天屏幕的右下角显示服务器安全状态。图标可悬停以获取更多信息。", "option.NoChatReports.showServerSafety.moreInfo": "§b单击此处阅读有关服务器安全级别的更多信息", diff --git a/src/main/resources/assets/nochatreports/lang/zh_tw.json b/src/main/resources/assets/nochatreports/lang/zh_tw.json index ae20798..a3e3470 100644 --- a/src/main/resources/assets/nochatreports/lang/zh_tw.json +++ b/src/main/resources/assets/nochatreports/lang/zh_tw.json @@ -27,34 +27,7 @@ "gui.nochatreports.ncr_toggle_tooltip": "No Chat Reports:%1$s\n禁用或啟用模組的大部分用戶端功能。你可能必須這樣做才能加入一些Paper/Velocity伺服器,因為它們會導致NCR問題。\n某些與網路無關的事情,如加密、聊天信任狀態調整和刪除原版的“聊天消息無法驗證”警告彈窗仍然有效;它們可以在配置中單獨禁用。",
"gui.nochatreports.ncr_state_on": "§a§l啟用§r",
"gui.nochatreports.ncr_state_off": "§c§l禁用§r",
- "tag.nochatreports.encrypted": "加密方式:%1$s",
- "tag.nochatreports.encrypted_original": "未解密:%1$s",
- "gui.nochatreports.encryption_tooltip": "§l加密:§r%1$s\n右擊以配置。\n\n當啟用加密時,你可以通過在發送消息時按住Ctrl來暫時關閉。",
- "gui.nochatreports.encryption_tooltip_invalid": "§l加密:§r%1$s\n§c無效配置。按一下以配置。",
- "gui.nochatreports.encryption_state_on": "§a§l啟用§r",
- "gui.nochatreports.encryption_state_off": "§c§l禁用§r",
- "gui.nochatreports.encryption_warning.header": "關於加密",
- "gui.nochatreports.encryption_warning.contents": "你可以使用金鑰加密消息,只有知道此金鑰的人才能解密它們。當提供合適的金鑰並啟用該功能時,No Chat Reports將自動解密所有加密消息。\n建議你生成自訂加密金鑰,並僅通過協力廠商通道將其傳遞給其他人。按一下“瞭解更多資訊”以瞭解有關如何以及何時使用加密的更多資訊。",
- "gui.nochatreports.encryption_warning.check": "不再提示",
"gui.nochatreports.encryption_warning.learn_more": "瞭解更多",
- "gui.nochatreports.encryption_config.header": "加密設置",
- "gui.nochatreports.encryption_config.key_desc": "§l加密金鑰§r\n用於加密和解密消息的金鑰。它的格式取決於演算法;對於AES,它將是128位元的Base64編碼二進位資料。",
- "gui.nochatreports.encryption_config.passphrase_desc": "§l加密密碼短語§r\n你可以從自己選擇的密碼中匯出一個金鑰,而不是生成隨機金鑰。如果你使用這個-選擇一個強大的。並非所有演算法都支援密碼短語。",
- "gui.nochatreports.encryption_config.validation_ok": "金鑰檢測:§a§l正常",
- "gui.nochatreports.encryption_config.validation_failed": "金鑰檢測:§c§l失敗",
- "gui.nochatreports.encryption_config.dice_tooltip": "針對所選加密演算法生成新的隨機金鑰。",
- "gui.nochatreports.encryption_config.pass_not_allowed": "<不支持>",
- "gui.nochatreports.encryption_config.algorithm": "演算法:%1$s",
- "gui.nochatreports.encryption_config.default_key": "<默認:%1$s>",
- "gui.nochatreports.encryption_config.encrypt_public": "加密公共消息",
- "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R",
- "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\n標準對稱加密演算法。使用128位金鑰,輸出以Base64的特殊版本編碼,以允許通過Minecraft的聊天進行傳輸。有一個缺點是,消息長度將增加大約30%,如果超過長度限制,伺服器可能會截斷它們。",
- "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R",
- "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\n更高的安全性,但是消息大小嚴重增加(12位元組用於初始化向量,12位元組用於身份驗證標籤,頂部為Base64編碼)。是否選擇取決於你是否重視安全而不是其他。",
- "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R",
- "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\n與CFB8模式相比,安全性大大降低,但不需要初始化向量,從而節省了一些位元組。仍然比Caesar安全。",
- "algorithm.nochatreports.caesar.name": "Caesar",
- "algorithm.nochatreports.caesar": "§lCaesar§r\n數位密碼。有了這個,你基本上是希望人們會放棄,甚至不嘗試解密你的消息。這在很多情況下可能是正確的,所以使用它的可行性取決於你的威脅模型。\nKey應該是從1到1024的整數。移位元是按字元代碼而不是按字母順序進行的,以確保與任何語言相容。",
"nochatreports.connect.nokey_rejected": "伺服器拒絕沒有聊天簽名金鑰的連接。",
"nochatreports.connect.await": "等待重連:%1$s秒...",
"gui.nochatreports.signing_mode.always.tooltip": "這個模式啟用聊天簽名,就像原版用戶端那樣。",
@@ -118,8 +91,6 @@ "option.NoChatReports.signingCheckDelaySeconds.tooltip": "檢查白名單伺服器是否仍然強制聊天簽名的延遲(秒)。將此設置為0將導致對每次登錄嘗試執行檢查,類似于未列入白名單的伺服器。",
"option.NoChatReports.serverSigningChecks": "伺服器簽名檢查",
"option.NoChatReports.serverSigningChecks.tooltip": "白名單伺服器到最後一次簽名強制檢查時間的映射(以秒為單位)。這通常不需要手動編輯。",
- "option.NoChatReports.showEncryptionButton": "顯示加密按鈕",
- "option.NoChatReports.showEncryptionButton.tooltip": "將此設置為false只會阻止聊天螢幕中顯示加密按鈕。請注意,加密本身不會隨按鈕一起自動禁用。",
"configuration.NoChatReports.category.whitelistedServers": "加入白名單的伺服器",
"option.NoChatReports.whitelistedServers": "加入白名單的伺服器",
"option.NoChatReports.whitelistedServers.tooltip": "包含不應顯示“要求聊天簽名”警告螢幕的伺服器。當你在該螢幕中按一下“白名單伺服器”時,伺服器將添加到此列表中。\n每個條目都是一個字串,格式為§l<伺服器IP>:<埠號>§r。",
@@ -142,6 +113,5 @@ "gui.nochatreports.signing_mode.never_forced": "無法開啟",
"gui.nochatreports.signing_mode.prompt": "提示開啟",
"gui.nochatreports.signing_mode.on_demand": "按要求",
- "option.NoChatReports.addQueryData.tooltip": "允許伺服器在處理Ping時向用戶端發送其他資料。這用於顯示“安全伺服器”圖示以及其他一些技術用途。",
- "gui.NoChatReports.showEncryptionButtonWarning": "§c不禁用加密,它只隱藏按鈕!"
+ "option.NoChatReports.addQueryData.tooltip": "允許伺服器在處理Ping時向用戶端發送其他資料。這用於顯示“安全伺服器”圖示以及其他一些技術用途。"
}
diff --git a/src/main/resources/assets/nochatreports/textures/gui/encrypted_tag.png b/src/main/resources/assets/nochatreports/textures/gui/encrypted_tag.png Binary files differdeleted file mode 100644 index 858a330..0000000 --- a/src/main/resources/assets/nochatreports/textures/gui/encrypted_tag.png +++ /dev/null diff --git a/src/main/resources/assets/nochatreports/textures/gui/encryption_gui_icons.png b/src/main/resources/assets/nochatreports/textures/gui/encryption_gui_icons.png Binary files differdeleted file mode 100644 index 812c6ec..0000000 --- a/src/main/resources/assets/nochatreports/textures/gui/encryption_gui_icons.png +++ /dev/null diff --git a/src/main/resources/assets/nochatreports/textures/gui/encryption_toggle_button.png b/src/main/resources/assets/nochatreports/textures/gui/encryption_toggle_button.png Binary files differdeleted file mode 100644 index 951413e..0000000 --- a/src/main/resources/assets/nochatreports/textures/gui/encryption_toggle_button.png +++ /dev/null diff --git a/src/main/resources/mixins/common/nochatreports.mixins.json b/src/main/resources/mixins/common/nochatreports.mixins.json index c324b01..0dcedb3 100644 --- a/src/main/resources/mixins/common/nochatreports.mixins.json +++ b/src/main/resources/mixins/common/nochatreports.mixins.json @@ -28,8 +28,6 @@ "client.MixinServerData", "client.MixinServerStatusPinger$1", "client.MixinOnlineServerEntry", - "client.MixinChatComponent", - "client.MixinGuiMessageTagIcon", "client.MixinTitleScreen", "client.MixinMinecraft", "client.MixinClientPacketListener", |
