d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help For A Cipher > Thanks
Add Reply New Topic New Poll
Member
Posts: 3,823
Joined: Mar 1 2015
Gold: 789.00
May 23 2018 08:24am
I would like to bring a cipher with different algorithms to the exam, including AES, Cesare and maybe others. Unfortunately I am not good enough to program and I would need someone willing to help me.
The programs I currently use are Eclipse (JavaFX) and SceneBuilder, the software we use at school
If you have one already do I would be happy to receive it and try to understand it.
Thanks a lot to everyone!
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
May 25 2018 07:23am
I don't fully understand the question. What are you going to be using the ciphers for? If you need to actually use one it is quite simple in java. Start with:
Code
Cipher c = Cipher.getInstance("AES");


If you want to understand the cipher then looking at code isn't the right thing. You probably want to look here:
https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/aes-development/Rijndael-ammended.pdf
https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/archived-crypto-projects/aes-development

caesar cipher is easy to understand and to program. I just wrote this program to give you an example:

Code
package com.company;

import java.util.stream.IntStream;

public class Main {

public static void main(String[] args) {
final String input = "My Secret ABCDEFGHIJKLMNOPQRSTUVWXYZ";
final String words = input.toUpperCase();
IntStream.rangeClosed(0, 26).forEach(key -> {
System.out.println(ceasar(words, key));
});
}

private static String ceasar(String words, int key) {
return words.chars()
.map(i -> (char) i == ' ' ? ' ' : (i + key - 65) % 26 + 65)
.collect(StringBuilder::new,
StringBuilder::appendCodePoint,
StringBuilder::append).toString();
}
}


Go Back To Programming & Development Topic List
Add Reply New Topic New Poll