Skip to content

Finish#38

Open
berstix wants to merge 2 commits intodemologin:mainfrom
berstix:main
Open

Finish#38
berstix wants to merge 2 commits intodemologin:mainfrom
berstix:main

Conversation

@berstix
Copy link

@berstix berstix commented Oct 22, 2025

No description provided.

Copy link

@Khmelov Khmelov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Приложение требует серьезной доработки, реализованы две функции, поставил оценку C

System.out.println("Введите путь до файла:");
Scanner scanner = new Scanner(System.in);
String path = scanner.nextLine();
String temporaryPath = "C:\\Users\\berstix\\IdeaProjects\\CryptoAnalyzerPantera\\text\\outDecode.txt";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Так никогда не делают, например у меня даже диска Ц нет

String encryptedText = new String(Files.readAllBytes(Paths.get(path)), "UTF-8");


for (int key = 0; key < 200; key++) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Полностью вся логика в конструкторе это точно неправильно


public static void main(String[] args) {
try {
new Brutforce();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо было создать объект а затем вызывать какой-то его метод

int numberOfCod = scanner.nextInt();
int i;

File file = new File("C:\\Users\\berstix\\IdeaProjects\\CryptoAnalyzerPantera\\text\\outDecode.txt");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

То же самое




Encode() throws IOException {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Интересно если класс публичный то почему конструктор не публичный


Encode() throws IOException {
System.out.println("Введите путь до файла:");
Scanner scanner = new Scanner(System.in);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сканер клавиатуры это один объект их не должно быть много по всей программе

int i;


File file = new File("C:\\Users\\berstix\\IdeaProjects\\CryptoAnalyzerPantera\\text\\out.txt");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Опять абсолютный путь это всегда ошибка

"3) раскодировать файл спомощью Brute force, выберите цифру 3";


Scanner consnole = new Scanner(System.in);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот именно этот сканер и нужно передавать везде где он требуется

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Brutforce {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему-то приложение не разбито на пакеты. Даже для маленьких программ всегда используют пакеты для того чтобы понимать где логика где ввод где вывод

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants