RSA Encryption and Decryption: Creating Public and Private Keys for Secure Communication

  Рет қаралды 30,285

WhiteBatCodes

WhiteBatCodes

Күн бұрын

Пікірлер
@totoramos1211
@totoramos1211 3 жыл бұрын
You're amazing, greetings from México, Ajuuaa!!
@prabhattiwari5964
@prabhattiwari5964 2 жыл бұрын
Hey can you make video on how to calculate the time of encryption or decryption does the aes, des, rsa algorithm take
@WhiteBatCodes
@WhiteBatCodes 2 жыл бұрын
It's going to be a quick video because it's just using two dates, one before the execution and one after then calculating the difference between them.
@preethimerlin6189
@preethimerlin6189 2 жыл бұрын
Hi did you receive the answer?
@Kamranazam53
@Kamranazam53 Жыл бұрын
Hello, I have one question, if I already have EncryptedString (already encrypted by RSA), how I can use the same to Decrypt that. I tried but its not working. Please help in the same.
@ZaKeRGFX
@ZaKeRGFX 2 жыл бұрын
Hello :) thanks for the video. Btw you forgot tu put the code in the description :p
@WhiteBatCodes
@WhiteBatCodes 2 жыл бұрын
It does exist in the comments : www.thexcoders.net/java-ciphers-rsa/
@shwetasoni3380
@shwetasoni3380 2 жыл бұрын
Is it ok to use rsa encryption when message is too long ?
@WhiteBatCodes
@WhiteBatCodes 2 жыл бұрын
No, there is a max size for each key_size. If you have a long string you need to split it
@اسدالسنهحفيدعليوعمر
@اسدالسنهحفيدعليوعمر 2 жыл бұрын
thankn you
@mayurmunot1146
@mayurmunot1146 2 жыл бұрын
I need help for how to decrypt encrypted cipher text as my client send me a encrypted text in my response i want to decrypt that but dont know how to store that encrypted text and decrypt it
@Kamranazam53
@Kamranazam53 Жыл бұрын
hey , i also have same question, have you sorted it out? Please help in the solution.
@technicalknowledge9128
@technicalknowledge9128 2 жыл бұрын
Can u read one file my java i want to help
@leekokting9678
@leekokting9678 2 жыл бұрын
can anyone copy source code to me?
@InconnuO_O491
@InconnuO_O491 10 ай бұрын
there: import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PrivateKey; import java.security.PublicKey; import java.util.Base64; import javax.crypto.Cipher; public class RSA { private PrivateKey privateKey; public PublicKey publicKey; public RSA(){ try{ KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); generator.initialize(1024); KeyPair pair = generator.generateKeyPair(); privateKey = pair.getPrivate(); publicKey = pair.getPublic(); } catch(Exception ignored){ } } public String encrypt(String message) throws Exception{ byte[] messageToBytes = message.getBytes(); Cipher cipher = Cipher.getInstance("RSA"); cipher.init(Cipher.ENCRYPT_MODE, publicKey); byte[] encryptedBytes = cipher.doFinal(messageToBytes); return encode(encryptedBytes); } private String encode(byte[] data){return Base64.getEncoder().encodeToString(data);} public String decrypt(String encryptedMessage) throws Exception{ byte [] encryptedBytes = decode(encryptedMessage); Cipher cipher = Cipher.getInstance("RSA"); cipher.init(Cipher.DECRYPT_MODE,privateKey); byte[] decryptedMessage = cipher.doFinal(encryptedBytes); return new String(decryptedMessage, "UTF-8"); } private byte[] decode(String data) {return Base64.getDecoder().decode(data);} public static void main(String[] args){ RSA rsa = new RSA(); try{ String encryptedMessage = rsa.encrypt("LOL "); String decryptedMessage = rsa.decrypt(encryptedMessage); System.err.println("Encrypted: "+encryptedMessage); System.err.println("Decrypted: "+decryptedMessage); }catch(Exception ignored){} } }
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Cryptography 101 for Java developers by Michel Schudel
42:59
RSA Private & Public Key Encryption in Python
12:42
NeuralNine
Рет қаралды 57 М.
RSA algorithm step by step example
20:41
Programming w/ Professor Sluiter
Рет қаралды 110 М.
How does RSA Cryptography work?
19:40
Tom Rocks Maths
Рет қаралды 81 М.
Public Key Cryptography: RSA Encryption Algorithm
16:31
Art of the Problem
Рет қаралды 941 М.
RSA encryption and decryption algorithm in java
12:04
tutorial plus
Рет қаралды 1,7 М.
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН