+ All Categories
Home > Documents > JAVA Cryptography

JAVA Cryptography

Date post: 20-Mar-2016
Category:
Upload: phyre
View: 56 times
Download: 0 times
Share this document with a friend
Description:
JAVA Cryptography. 10 장 SafeTalk 시스템 소프트웨어 연구실 성순화 이재일. 목차. Using SafeTalk Under the Hood SafeTalk 구조 Session SessionServer Receiver SafeTalk. SafeTalk. SafeTalk: 유닉스 talk 유틸리티의 자바 애플리케이션으로 대화의 각 끝에 인증을 제공하거나 대화 그 자체를 암호화함으로써 안전한 talk 을 주고 받을 수 있도록 한다 . - PowerPoint PPT Presentation

of 32

Click here to load reader

Transcript
Ping Program(IP Record Route Option) & Traceroute ProgramSafeTalk
SafeTalk:
talk talk .
client incoming server .
hybrid system
session key -> EIGamal()
-> DES() session key
System Software Lab.
SafeTalk v1.0
Good. Where can we meet?
Disconnect
172.16.0.2
1. Key file : key pair
2. Safetalk class: - key pair
- session key
keyfile signer algorithm strength
Exporting a Key
Keyfile public key combobox
Export key .
Importing a Key
public key Import key public key key public key combo box .
SafeTalk exported key import .
System Software Lab.
Starting a Conversation
combo box combo box text field IP address Connect .
Receiving a Conversation
Loopback Testing
2 SafeTalk .
System Software Lab.
identity 2 keyfile .
Default SafeTalk port 7999 listen port .
<>
Safetalk keyfile port number command-line argument . public key .
C:\ java SafeTalk Keys.ser 7999 8001 Key.ser 8001 7999
keyfile connect port listen port
listen port keyfile connect port
System Software Lab.
SessionServer: incoming socket Session .
Receiver: incoming data Session . Session SafeTalk incoming data SafeTalk window lower text area .
SafeTalk:SafeTalk class GUI Frame Subclass.
KeyManager: public key key pair . Session Session key KeyManager SafeTalk key import.export KeyManager .
System Software Lab.
Session class
connect( ) :
disconnect( ) :
isConnected( ) :
send( ) : data
Session’s receiverData( ) : Receiver object data data callback call.
System Software Lab.
Session Key
initiateConnection( ): SafeTalk key . Connect( ) .
Session’s respond-ToConnection: SessionServer
concatenate( ) SetupCipherStream( ): initiateConnection( ) respondToConnection( ) .
< 1>
member .
port Session Session mListenPort mConnectPort outgoing calls
default 7999ports set.
System Software Lab.
Session
<1>
Session Socket mSocket member . member mOut mSocket
data write OutputStream.
Session SafeTalk KeyManager future reference incoming listen SessionServer .
import iava.io.*;
import iava.net.*;
int listenport, int connectPort) {
connect( ) IP IP address
string InetAddress socket . connect( ) session key
initiateConnection( ) call.
. SafeTalk object sessionDisconnect( ) call disconnection GUI .
isConnected( ) self-explanatory.
SafeTalk window text type keystrokes Session send( ) .
Receiver data Session receiverData( ) call GUI data mSafeTalk .
System Software Lab.
throws Exception{
initiateConnection(client, user);
public void send(char c) {
catch (IOException ioe ) {}
SafeTalk session key .
1. Client IV DES .
2. Client server() public key IV key half
.
3. Client step2 server data .
4. Server private key data .
System Software Lab.
5. Server session key half .
6. Server client public key IV key half .
7. Server step6 client data .
8. Client private key data .
- > client server key session key
System Software Lab.
data KeyManager server public key
concatenate( ) 2 return.
data server server session key IV .
session key generate
client public key IV
data client .
Private key session key data .
System Software Lab.
DES CFB .
Stream GUI sessionConnect( ) call
.
throws Exception {
mSocket = s;
SecureRandom sr=new SecureRandom( );
sr.nextBytes (iv);
out.writeUTF(mKeyManager.getName ( ) );
out.writeInt(ciphertext.length);
in.read(remoteEncrypted);
System.arraycopy(decrypted, 0, secondHalf, 0,secondHalf.length);
incoming connection .
client client name server data public key .
data server private key .
server session key data IV .
Session key generate IV
KeyManager client’s public key .
System Software Lab.
server client .
Client session key talk GUI sessionRespond( ) call .
Concatenate( ) 2 byte .
public void respondToConnection(Socket s)
if (isConnected ( ) ) {
in.readFully(remoteEncrypted);
new SecureRandom( ).nextBytes(secondHalf);
System.arraycopy(a,0,r,0,a.length);
Session
<5>
Session client server session key initiateConnection( ) respondToConnection( ) setupCipherStream( ) call.
SecretKeyFactory key halves .
. streams CipherInputStream CipherOutputStream class (DES in CFBmode)
incoming data
outgoing data .
SystemSoftware Lab.
byte[ ] iv) throws Exception {
byte[ ] keyBytes=concatenate(firstHalf, secondHalf);
SecretKeyFactory skf=SecretKeyFactory.getInstance(“DES”) ;
DESKeySpec desSpec=new DESKeySpec(keyBytes);

Recommended