University Semester.
Added on 2023-03-30
8 Pages456 Words107 Views
University
Semester
Information Security
Student ID
Student Name
Submission Date
1
Semester
Information Security
Student ID
Student Name
Submission Date
1
Table of Contents
Task 2.........................................................................................................................................................3
a) Hybrid Encryption Method..........................................................................................................3
b) Decryption Process........................................................................................................................5
c) Mathematical Formula..................................................................................................................7
d) Vulnerability..................................................................................................................................8
2
Task 2.........................................................................................................................................................3
a) Hybrid Encryption Method..........................................................................................................3
b) Decryption Process........................................................................................................................5
c) Mathematical Formula..................................................................................................................7
d) Vulnerability..................................................................................................................................8
2
Task 2
a) Hybrid Encryption Method
package com.mkyong.keypair;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.PublicKey;
public class GenerateKeys {
private KeyPairGenerator keyGen;
private KeyPair pair;
private PrivateKey privateKey;
private PublicKey publicKey;
public GenerateKeys(int keylength)
throws NoSuchAlgorithmException, NoSuchProviderException {
this.keyGen = KeyPairGenerator.getInstance("RSA");
this.keyGen.initialize(keylength);
}
public void createKeys() {
this.pair = this.keyGen.generateKeyPair();
this.privateKey = pair.getPrivate();
this.publicKey = pair.getPublic();
}
3
a) Hybrid Encryption Method
package com.mkyong.keypair;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.PublicKey;
public class GenerateKeys {
private KeyPairGenerator keyGen;
private KeyPair pair;
private PrivateKey privateKey;
private PublicKey publicKey;
public GenerateKeys(int keylength)
throws NoSuchAlgorithmException, NoSuchProviderException {
this.keyGen = KeyPairGenerator.getInstance("RSA");
this.keyGen.initialize(keylength);
}
public void createKeys() {
this.pair = this.keyGen.generateKeyPair();
this.privateKey = pair.getPrivate();
this.publicKey = pair.getPublic();
}
3
End of preview
Want to access all the pages? Upload your documents or become a member.
Related Documents
Encryption Algorithm Assignmentlg...
|6
|1103
|186