Posts

Android RSA Crypto Code

 RSA Example We use the following Java code to encode text " Open Source Java Projects OFLAMERON " using the RSA algorithm and its subsequent decoding    // Original text     String testText = " Open Source Java Projects OFLAMERON ";     TextView originalTextView = (TextView) findViewById(R.id.textViewOriginal);     originalTextView.setText("[ORIGINAL]:\n" + testText + "\n");     // Generate key pair for 1024-bit RSA encryption and decryption     Key publicKey = null;     Key privateKey = null;     try {         KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");         kpg.initialize(1024); //1024 Key         KeyPair kp = kpg.genKeyPair();         publicKey = kp.getPublic(); //Public Key      ...

Android Crypto Project

  Open Source Java Project The RSA algorithm provides significantly stronger encryption than AES It uses asymmetric encryption as opposed to AES. Writing Java code for RSA encryption is much more difficult if you do not use Android's internal algorithms.   We use it. Let's take the previous Open Source Project project as a basis   Source Code - CryptoNOTE_AES.ZIP  https://drive.google.com/file/d/1QhW9SRS6-fWGyV6hAAifxlUFe8PngCn9/view?usp=sharing   Full Java Project Open Source Java Project  

CryptoNOTE AES

 Open Source Java Projext Android Studio Now we will show how to encrypt text in AES. Highlighted comment - the simplest encryption option with which the application was debugged In Main Activity     //==========================================================     //   Text oflameron.txt CODING     //==========================================================     public void Code() {         char ec = 0; //One character from the read text         String KTxt = ""; //Encoded text         elenght = str.length(); //Amount of data from EditText to encode         // The number of characters in the oflameron.txt file - in the elenght variable         // Encoding text from str variable         // Encoding is simpl...

CryptoNOTE Open Source Project

  AES encryption Class This is class AESHelper in project CryptoNOTE     private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception {         SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");         Cipher cipher = Cipher.getInstance("AES");         cipher.init(Cipher.ENCRYPT_MODE, skeySpec);         byte[] encrypted = cipher.doFinal(clear);         return encrypted;     }   Encryption and decryption      private static byte[] decrypt(byte[] raw, byte[] encrypted) throws Exception {         SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");         Cipher cipher = Cipher.getInstance("AES");         cipher.init(Cipher.DECRYPT_MO...

CryptoNOTE Open Source Project

  AES encoding The project of a simple notepad with AES encryption of entries. For data that not everyone needs to read.   Earlier we published a complete Java project with a dynamic password that does not need to be remembered. You just know how to form it in order to enter the program. If the answer is entered correctly, then the data will be decoded. Now consider the class for AES data encryption     private static byte[] getRawKey(byte[] seed) throws Exception {         KeyGenerator kgen = KeyGenerator.getInstance("AES");         SecureRandom sr = SecureRandom.getInstance(" SHA1PRNG "," Crypto ");         sr.setSeed(seed);         kgen.init( 128 , sr); // 192 and 256 bits may not be available         SecretKey skey = kgen.generateKey();         byte...

AES encoding

  Open Source Project AES encoding class public class AESHelper {     //     // Class for encrypting and decoding text     // In MainActivity class     // encrypt() - encryption     // decrypt() - decode     //     // ...     public static String encrypt(String seed, String cleartext) throws Exception {         byte[] rawKey = getRawKey(seed.getBytes());         byte[] result = encrypt(rawKey, cleartext.getBytes());         return toHex(result);     }     public static String decrypt(String seed, String encrypted) throws Exception {         byte[] rawKey = getRawKey(seed.getBytes());         byte[] enc = toByte(encrypted);       ...

CryptoNOTE with AES

  Open Source Java Project The full version of the Java project with AES encryption is available for download.  CryptoNOTE_AES.ZIP  https://drive.google.com/file/d/1QhW9SRS6-fWGyV6hAAifxlUFe8PngCn9/view?usp=sharing   Open Source Java Project