Java Assignment Related

Slides:



Advertisements
Similar presentations
MOD III. Input / Output Streams Byte streams Programs use byte streams to perform input and output of 8-bit bytes. This Stream handles the 8-bit.
Advertisements

CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Overview of Java I/O. Stream A Program often needs to read/write information from/to outer source/destination. Outer source/destination can be : –A File.
Advanced Java Class Serialization. Serialization – what and why? What? –Translating the contents of an Object to a series of bytes that represent it,
Csci5233 Computer Security1 GS: Chapter 5 Asymmetric Encryption in Java.
Chapter 20 – Streams and Binary Input/Output Big Java Early Objects by Cay Horstmann Copyright © 2014 by John Wiley & Sons. All rights reserved.
1 Homework Study Java Cryptography by Reading the rest of slides and accessing Sun ’ s Java website:
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
Monitor's Secret Key Crypto - KARN, encrypt 512 bit Secret.
1 Hashes and Message Digests. 2 Hash Also known as –Message digest –One-way function Function: input message -> output One-way: d=h(m), but not h’(d)
Implementing RSA Encryption in Java
JAVA I/O © EnhanceEdu, IIIT Hyderabad. Contents 3/29/2010EnhanceEdu, IIIT - H 2  Command Line I/O  File Class  Streams  Byte Streams [Low level and.
Public Key (RSA) Day 27. Objective Students will be able to… …understand how RSA is used for encryption and decryption. …understand some of the challenges.
Computer Network Lab. Encryption 컴퓨터 네트워크 실험실 조한진 / 이희규.
CIS 270—App Dev II Big Java Chapter 19 Files and Streams.
1 Session 3 Module 4: Java Security Module 5: Cryptography.
Streams & Files. Java I/O Classes Saving data to / Loading data from files Two Choices: Binary-Formatted or Text-Formatted Data – int x = 1234; – Binary.
DIGITAL SIGNATURE IMPLEMENTATION
CPRG 215 Introduction to Object-Oriented Programming with Java Module 2- Using Java Built-in Classes Topic 2.6 Reading Input with java.io Produced by Harvey.
Java Input/Output. Java Input/output Input is any information that is needed by your program to complete its execution. Output is any information that.
JCA, Cryptography for Java Programmer Shawn Shuang Zhang CS 627.
Agenda Socket Programming The OSI reference Model The OSI protocol stack Sockets Ports Java classes for sockets Input stream and.
Java Programming, Second Edition Chapter Sixteen File Input and Output.
Java Cryptography Nick Pullman DSU-MSIA Citigroup Information Security
LAB#6 MAC & MASSAGE DIGEST CPIT 425. Message Authentication 2  Message authentication is a mechanism used to verify the integrity of a message.  Message.
LAB#4 PROGRAMMING USING JAVA CRYPTOGRAPHIC LIBRARIES CPIT 425.
Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.
Chapter 10: I/O Streams Input Streams Output Streams
The Java IO System Different kinds of IO Different kinds of operations
Keerthi Nelaturu Url: site.uottawa.ca/~knela006
Sequential files creation & writing
IO in java.
Encryption Take 2: Practical details
Information and Computer Security CPIS 312 Lab 9
Java Assignment Related
Lab#7 Digital signature Cpit 425
Public Key Encryption.
Advanced Computer Networks
Vocabulary Big Data - “Big data is a broad term for datasets so large or complex that traditional data processing applications are inadequate.” Moore’s.
Object Writing in files
K E Y Plain text Cipher text Encryption Decryption
Network Security.
Outline of implementation
Chapter 8 Network Security.
One-way Encryption Ideal Properties
Encryption
Vernam Cipher Group Members: Muhammad Awais Muhammad Hasnain khan
- Stream Cipher and Block Cipher - Confusion & Diffusion
I/O Basics.
One-way Encryption Properties
Chapter 13: File Input and Output
Chap 6: Security and Protection
Input: A={a1, a2, … an} – public key, S - ciphertext
نوع داده هاي انتزاعي Abstract Data Types
GS: Chapter 4 Symmetric Encryption in Java
PART VII Security.
Unit 2 “Implementation of a RC5 block cipher algorithm and implementing an attack on it”
Rivest, Shamir and Adleman
Cryptography Team Presentation 1
Analysis of the RSA Encryption Algorithm
Symmetric-Key Encryption
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
Input and Output Stream
The Hanoi Tower Problem
Network Security.
Block Ciphers: DES and AES
CS 240 – Advanced Programming Concepts
Computer Security Chapter Two
Basics Of Symmetric Encryption
OO Java Programming Input Output.
Presentation transcript:

Java Assignment Related

Message digest MessageDigest class Producing byte array getInstance(“SHA”) update(byte []) dijest(); digest(byte []) Producing byte array DataOutputStream to ByteOutputStream Write data types: writeLong(l) toByteArray in ByteOutputStream

Key, KeyGenerator Key: KeyGenerator: top-level interface for all keys. defines the functionality of all key objects. KeyGenerator: This class provides the functionality of a (symmetric) key generator. static KeyGenerator getInstance(String algorithm) Generates a KeyGenerator object for the specified algorithm. void init(SecureRandom random) Initializes this key generator. SecretKey generateKey() Generates a secret key.

Cipher, static Cipher getInstance(String transformation) Generates a Cipher object that implements the specified transformation. You can use “DES/ECB/PKCS5Padding” void init(int opmode, Key key) Initializes this cipher with a key. Field Detail public static final int ENCRYPT_MODE Constant used to initialize cipher to encryption mode. public static final int DECRYPT_MODE Constant used to initialize cipher to decryption mode.

CipherOutputstream CipherInputstream CipherOutputStream(OutputStream os, Cipher c) Constructs a CipherOutputStream from an OutputStream and a Cipher. void write(byte[] b) Writes b.length bytes from the specified byte array to this output stream. CipherInputStream(InputStream is, Cipher c) Constructs a CipherInputStream from an InputStream and a Cipher. int read(byte[] b) Reads up to b.length bytes of data from this input stream into an array of bytes. void close() Closes this output/input stream and releases any system resources associated with this stream.

Big Integer BeigInteger(1, messagebytes) x/y mod z BigInteger.valueOf(1) x/y mod z X.multiply(y.modPow(kOne.negate(), z)).mod(z) k relatively prime to z k.gcd(z).equals(kOne) == true