Skip to content

Instantly share code, notes, and snippets.

public class Cipher {
// private int smesh = (int)'a';
String Alph = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя";
public String enc (String text){
StringBuilder ans = new StringBuilder();
for (int i=0; i<text.length();i++){
String[] m = text.split("");
String element = m[i];
int num = Alph.indexOf(element)+i;
char a = (char) Alph.charAt(num);
package javaapplication5;
import java.util.Scanner;
import java.util.Random;
import java.math.BigInteger;
public class MillerRabin {
/** Function to check if prime or not **/
public static long random (long a){
long k = 0;
public class Evklid {
int x1;
int y1;
int Evklid (int a, int b, int x, int y) {
if (a == 0) {
x = 0; y = 1;
return b;
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String _alphabet = "ЙЦУКЕНГШЩЗХФЪЫВАПРОЛДЖЭЧСМИТЬБЮ";
String _line= "";
int k,m = 0;
_line = jTextField1.getText();
// char[] digit = _line.toLowerCase().toCharArray();// чар нижний
String _cryptedString = "";
String c, _l = "";
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String _alphabet = "ЙЦУКЕНГШЩЗХФЪЫВАПРОЛДЖЭЧСМИТЬБЮ";
String _line= "";
char[] digit = _line.toLowerCase().toCharArray();// чар нижний
String _cryptedString = "";
Random r = new Random();
int [] l = new int[] {11, 18, 25, 2, 9, 10, 12, 19, 21, 3, 4, 6, 13, 20, 22, 23, 5, 7, 14, 16, 17, 24, 1, 8, 15};