cryptopals

This commit is contained in:
kaltinsoy committed 2025-02-16 20:33:56 +03:00
1 parent aea61f2076
commit 1702b10d27
3 files changed
+79

No files matched your search

@@ -0,0 +1,22 @@
import java.util.Base64;
import java.util.HexFormat;
import java.util.Scanner;
public class hexToBase64 {
public static void main(String[] args) {
HexFormat hex = HexFormat.of();
Scanner scan = new Scanner(System.in);
System.out.println("Enter hex!");
String hexString = scan.next();
byte[] byteString = HexFormat.of().parseHex(hexString);
String convertedHex = Base64.getEncoder().encodeToString(byteString);
scan.close();
System.out.println(convertedHex);
}
}