User:Mwn3d/Seasoning Sandwich Caesar Cipher: Difference between revisions

Content added Content deleted
(This is probably getting way too crazy...add code to make the noise look more like the actual message with word length restrictions)
m (Use SecureRandom since it's cryptography)
Line 3: Line 3:


import java.util.Random;
import java.util.Random;
import java.security.SecureRandom;


public class Cipher{
public class Cipher{
Line 62: Line 63:
StringBuilder noise = new StringBuilder();
StringBuilder noise = new StringBuilder();
Random rand = new Random();
Random rand = new SecureRandom();
double meanLen = getMeanLen(orig.split("\\b++"));
double meanLen = getMeanLen(orig.split("\\b++"));
double std = getStdDev(orig.split("\\b++"));
double std = getStdDev(orig.split("\\b++"));
Line 135: Line 136:
{{out}}
{{out}}
<pre>The quick brown fox Jumped over the lazy Dog and then he landed on a cat and it hurt
<pre>The quick brown fox Jumped over the lazy Dog and then he landed on a cat and it hurt
trnifd lc d dh o ftq cguow ndaiz raj vgybqp ahqd ftq xmlk pas mzp ftqz tq xmzpqp az m omf mzp uf tgdf ove edh u lc vox wjb hl uc giv lrxr uxwgh beyw ab scj a knhst ngso l byc yjiy ejkb iwp sns ins ie mvclru eknv yowr ju ywbkgre kkj v xhz x
tsl wu ebjc usjx ab ld xuj tx jos g rl nj ne khnh hg ny fsr su yvik kj wds vvw bxyu xwld lhn mrrl wdv wocvr h gep oeb bzyi ftq cguow ndaiz raj vgybqp ahqd ftq xmlk pas mzp ftqz tq xmzpqp az m omf mzp uf tgdf ve ci cci ekh ykcbi ar oiy ek ong
hgz ki spxq igxl op zr lix hl xcg u fz bx bs yvbv vu bm tgf gi mjwy yx krg jjk plmi lkzr zvb affz krj kcqjf v usd csp pnmw the quick brown fox jumped over the lazy dog and then he landed on a cat and it hurt js qw qqw syv myqpw of cwm sy cbu</pre>
hfbwtr zq r rv c the quick brown fox jumped over the lazy dog and then he landed on a cat and it hurt cjs srv i zq jcl kxp vz iq uwj zflf ilkuv psmk op gqx o ybvgh bugc z pmq mxwm sxyp wkd gbg wbg ws ajqzfi sybj mckf xi mkpyufs yyx j lvn l</pre>