Modulasi Analog dan Modulasi Digital dengan Input .wav (Simulink)


Kali ini kita mendapat tugas, bagaimana mentransmisikan sinyal suara .wav menggunakan Modulasi Digital dan Modulasi Analog dalam simulink. Dengarkan hasil kualitas suaranya!

Screenshot from 2016-01-31 11:27:56

Skema simulink diatas adalah satu cara untuk mentransmisikan data menggunakan modulasi Analog dan Digital, bagian atas adalah modulasi Analog menggunakan SSB AM dan Bagian bawah adalah digital mengunakan DBPSK. Perlu diketahui untuk input modulasi digital data merupakan data diskrit atau data digital. Oleh sebab itu kita memerlukan konversi dari bentuk suara ke bentuk diskrit/digital.

Hal ini sering disebut ADC (analog to Digital Converter) namun saya tidak ingin menyebutkan di simulasi ini adalah ADC karena pada dasarnya file .wav ini sendiri sudah dalam bentuk digital/diskrit karena sudah tersimpan didalam disk berupa file digital berbentuk .wav. Sejenak kita lupakan tentang kontroversi ADC ini sendiri. kembali kedalam modulasi

Sebelum masuk ke dalam modulasi digital kita menambahkan blok Uniform Encoder dan integer to bit. Blok Uniform Encoder ini merupakan proses Kuantisasi yang menggunakan standart ITU-T Recommendation G.701. Hal ini lazim digunakan pada data file suara yang tidak terkompresi.

Setelah file terkuantisasi dalam bentuk diskrit, kita perlu merubah nilai nilai diskrit tersebut ke bentuk digital atau binary. Blok yang kita bisa gunakan adalah Blok Integer to Bit. Sebenarnya kurang tepat juga kita mengatakan blok tersebut adalah blok yang mengubah bentuk nilai integer kdealam bentuk binary karena hasil quantisasi bisa dalam bentuk floating point atau nilai angka berkoma, namun jangan terlalu pusing dengan intepretasi tipe variable Integer atau Floating sebab di dalam blok Uniform encoder dan Integer to Bit kita bisa mensetting berapa bit yang akan kita gunakan. yang kita gunakan dalam simulasi ini adalah 8 bit karena encoder yang digunakan dari file .wav itu sendiri 8 bit.

Dimana proses sampling? sebenarnya proses sampling ada didalam file itu sendiri yaitu 8Khz. Jika kita runut kembali proses sampling-Kuantisasi-Encoding adalah proses ADC, yang kita simulasikan kembali di Simulink, ya kita hanya mensimulasikan kembali tanpa sebenarnya melakukan proses dari ADC itu sendiri dikarenakan sebenarnya proses ADC itu sendiri sudah terjadi disaat kita merekam suara tersebut

File Simulink dapat didowload dilink berikut, run file simulink tersebut dan bandingkan suaranya, kita juga bisa bandigkan hasi dari grafik waktu ataupun grafik frequency disetiap stepnya menggunakan block spectrum dan time scope.

File Simulink
File .wav (sumber )

Respon Impuls Filter Digital Matlab Simullink


Sebagai contoh kita diberikan tugas, buat skema respon impuls filter digital (direct Form 1) dibawah ini pada simulink

vcxz

dengan spesifikasi sebagai berikut

Filter BPF (Wstop1 = 0.0625, Wstop2=0.0875, Wpass1=0.2625, Wpass2=0.2875), Rp = 1dB, Rs = 60dB

pada dasarnya kita dapat membuat implementasi dalam code matlab secara mudah dan langsung sebagai berikut:

Sebagai contoh kita menggunakan sepesifikasi filter Band Pass Filter BPF dengan spesifikasi diatas

clc, clear all
Ws = [0.0625 0.2875];
Wp = [0.0875 0.2625];
Rp = 1;
Rs = 60;
[n, Wn]= ellipord(Wp, Ws, Rp, Rs);
[b, a] = ellip(n, Rp, Rs,  Wn);
t=0:0.01:1;
X=1*sin(2*pi.*t);
y = filter(b,a,X);
figure,
freqz(b,a)
figure,
subplot(2,1,1)
plot(t,X)
subplot(2,1,2)
plot(t,y), grid on

hasil grafik yang kita dapatkan adalah, sebagai berikut
Screenshot from 2016-01-31 10:39:33
Respon Magnitude dan Fasa Filter yg ditampilkan melalui freqz(b,a)

Screenshot from 2016-01-31 10:40:43
grafik 1 dalah grafik sinyal input berupa sinusiodal dan grafik dibawahnya adalah grafik sinyal output yang telah terfilter menggunakan y = filter(b,a,X);

Nilai a (denumerator) dan b (numerator)

a =

1.0e+03 *

Columns 1 through 6

0.0010 -0.0114 0.0625 -0.2155 0.5241 -0.9507

Columns 7 through 12

1.3259 -1.4439 1.2337 -0.8231 0.4222 -0.1615

Columns 13 through 15

0.0436 -0.0074 0.0006

>> b

b =

Columns 1 through 6

0.0021 -0.0182 0.0758 -0.1945 0.3376 -0.3977

Columns 7 through 12

0.2769 0.0000 -0.2769 0.3977 -0.3376 0.1945

Columns 13 through 15

-0.0758 0.0182 -0.0021

hasil tersebut sudah cukup untuk kita mengetahui bagaimana membuat filter dan menggunakan filter tersebut dalam program matlab, namun bagaimana untuk di simulink
Disimulink setidaknya ada 3 cara yaitu menggunakan Filter FDA tools, Discrete filter block dan membuat response impluse sendiri. Namun dengan menggunakan Discrete filter block dan membuat response impluse sendiri kita harus mencari nilai a dan b terlebih dahulu bisa menggunakan code diatas ata FDA tools, berikut simulasi pada simulink:

Screenshot from 2016-01-31 10:51:25
simulink block

Screenshot from 2016-01-31 10:51:53
hasil input dan output

jika kita perhatikan file diatas mengapa hasil filter dari grafik ke 2 berbeda dengan grafik ke 3 & 4? hal tersebut terjadi karena perbedaan penggunaan direct form dalam implementasi tranformasi Z pada filter, Grafik 2 atau hasil Dari FDA tool box menggunakan direct form II sebagai mana ditampilkan ada screenshoot berikut:
Screenshot from 2016-01-31 11:06:25

Sedangkan pada grafik 3 dan 4 kita menggunakan Direct form I, tentunya kita dapat memodifikasi design kita menggunakan Direct form I atau Direct Form II sesuai dengan kebutuhan kita, selain perbedaan pada Direct form, juga terdapat perbedaan pada ordo yang digunakan pada FDA toolboox orde yang digunakan sebanyak 18 sedangkan pada grafik 3&4 menggunakan ordo sebanyak 15. Tentunya kita bisa mendalami lagi mengenai parameter parameter lainnya pada filter digital

file dapat didownload di link berikut:
File Simulink https://www.dropbox.com/s/wn5mo8bqbhgxuif/FilterBPFPro2x1.mdl?dl=0
File mfile https://www.dropbox.com/s/z9k5014zpcbahfy/Set_parameter.m?dl=0

Enkripsi Citra menggunakan javax.crypto bagian 2


Setelah kita mencoba membuat enkripsi citra http://wp.me/prw8r-1cR, namun hasil enkripsi tidak dapat dilihat dikarenakan perubahan pada header citra digital yang menyebabkan komputer tidak dapat mendeteksi type file dll.

setidaknya ada 2 alternatif untuk mengatasi masalah tersebut, alternatif pertama adalah enkripsi dilakukan hanya pada byte nilai pixel dan juga enkripsi tidak dilakukan pada file-file header. Cara tersebut sangat cocok bagi type file uncompressed seperti .bmp dikarenakan niai-nilai byte pada pixel berkisar antara 0-255 dan memiliki letak posisi yang jelas pada posisi format byte. sebagai contoh berikut

Screenshot from 2016-01-27 09:13:52

perhatikan pada posisi byte ke 10 dengan nilai 0x36 dalam format .bmp kita dapat mendapatkan posisi awal dari nilai pixel yaitu pada byte ke 36, detailnya bisa dilihat di https://en.wikipedia.org/wiki/BMP_file_format dengan begitu kita dapat mengenkripsi hanya pada nilai pixel nya tanpa mengenkripsi headernya atau informasi lainnya.


import imageEncryption.ImageBMP;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.imageio.ImageIO;

	public class Des_imagebezheader {
		KeyGenerator keyGenerator = null;  
	    SecretKey secretKey = null;  
	    Cipher cipher = null;  
	  
	    public Des_imagebezheader() {  
	        try {   
	            keyGenerator = KeyGenerator.getInstance("DES");  
	            secretKey = keyGenerator.generateKey();  
	            
	            
	            cipher = Cipher.getInstance("DES/ECB/NoPadding");  
	        } catch (NoSuchPaddingException ex) {  
	            System.out.println(ex);  
	        } catch (NoSuchAlgorithmException ex) {  
	            System.out.println(ex);  
	        }  
	    }  
	    
	    public static void main(String[] args) throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException, IOException {  
	        String fileToEncrypt = "XING_B24.BMP";  
	        String encryptedFile = "encryptXING_B24.bmp";  
	        String decryptedFile = "decryptXING_B24.bmp";    
	        String directoryPath = "/media/ratjoen/javaFiles/Izhobrazhenie_KriptografiyV3.0L/";  
	        Des_imagebezheader encryptFile = new Des_imagebezheader();  
	        System.out.println("Starting Encryption...");  
	        encryptFile.encrypt(directoryPath + fileToEncrypt,  
	                directoryPath + encryptedFile);  
	        System.out.println("Encryption completed...");   
	        
	        System.out.println("Starting Decryption...");  
	        encryptFile.decrypt(directoryPath + encryptedFile,  
	                directoryPath + decryptedFile);  
	        System.out.println("Decryption completed...");
	    }  
	    
	    private void encrypt(String srcPath, String destPath) throws InvalidKeyException, IOException, IllegalBlockSizeException, BadPaddingException {  
	        File rawFile = new File(srcPath);  
	        File encryptedFile = new File(destPath);  
	        InputStream inStream = null;  
	        OutputStream outStream = null;  
	     
	        cipher.init(Cipher.ENCRYPT_MODE, secretKey);  
	        
	        try {
	        inStream = new FileInputStream(rawFile);
	        outStream = new FileOutputStream(encryptedFile);  

	        int lengfile = (int) rawFile.length() ;
	       
	        byte[] buffer = new byte[lengfile]; 
	        inStream.read(buffer);
	        
	        System.out.println(buffer.length);
	        int startP = buffer[10];//for bmp format
	        System.out.println(startP);
	        
	        int lengthE = lengfile-startP;
	       
	        
	        byte[] bufferE = new byte[lengthE]; 
	       
	        for (int i = 0; i < bufferE.length ; i++){
	        	bufferE[i]=buffer[i+startP];
	        }
	        
	        byte[] bufferP = new byte[lengthE]; 
	        
	        cipher.update(bufferE, 0, lengthE , bufferP, 0);
	        cipher.doFinal(bufferP);  
	        
	        for (int i = 0; i < bufferE.length ; i++){
	        	buffer[i+startP]=bufferP[i];
	        }
	        
	        outStream.write(buffer);  
            outStream.flush();
	       
	        }catch(Exception e){
	        	e.printStackTrace();
	        }
	    }
	           	 
	          
	    private void decrypt(String srcPath, String destPath) throws InvalidKeyException, IOException, IllegalBlockSizeException, BadPaddingException {  
	        File rawFile = new File(srcPath);  
	        File encryptedFile = new File(destPath);  
	        InputStream inStream = null;  
	        OutputStream outStream = null;  
	     
	        cipher.init(Cipher.DECRYPT_MODE, secretKey);  
	        
	        try {
	        inStream = new FileInputStream(rawFile);
	        outStream = new FileOutputStream(encryptedFile);  

	        int lengfile = (int) rawFile.length() ;
	        String Format = rawFile.getName();
	        byte[] buffer = new byte[lengfile]; 
	        inStream.read(buffer);
	        
	        System.out.println(buffer.length);
	        int startP = buffer[10];//for bmp format
	        System.out.println(startP);
	        
	        int lengthE = lengfile-startP;
	       
	        
	        byte[] bufferE = new byte[lengthE]; 
	       
	        for (int i = 0; i < bufferE.length ; i++){
	        	bufferE[i]=buffer[i+startP];
	        }
	        
	        byte[] bufferP = new byte[lengthE]; 
	        
	        cipher.update(bufferE, 0, lengthE , bufferP, 0);
	        cipher.doFinal(bufferP);  
	        
	        for (int i = 0; i < bufferE.length ; i++){
	        	buffer[i+startP]=bufferP[i];
	        }
	        
	        outStream.write(buffer);  
            outStream.flush();
	       
	        }catch(Exception e){
	        	e.printStackTrace();
	        }
	    }        
	}

Screenshot from 2016-01-27 09:34:08

Screenshot from 2016-01-27 09:34:00

Menggambar kurva 2D, kurva 3D dan menghitung integral pada matlab


contoh soal sebagai berikut (sumber https://www.facebook.com/groups/570918222980206/)
12645270_1218062701556010_5345357511037463031_n

clear, close all, clc
%No1 http://www.mathworks.com/help/matlab/ref/plot.html
x=-10:0.1:10;
y1=sqrt(49+4.*x.^2);
y2=sqrt(64+3.*x.^2);
plot(x,y1),hold on, grid on
plot(x,y2,'r')
%No2 http://www.mathworks.com/help/matlab/ref/plot3.html
t=0:0.1:2*pi;
x=1+cos(t);
y=2+sin(t);
z=1-cos(2.*t);
figure
plot3(x,y,z), grid on
%No3a http://www.mathworks.com/help/symbolic/int.html
syms x y
pretty(int(2*x*y*exp(2*y),y))
%No3b http://www.mathworks.com/help/matlab/ref/integral.html
fun = @(x,y) 10-2.*x.^2-y.^2
q = integral2(fun,-4,5,-5,5)
%No3c http://www.mathworks.com/help/symbolic/diff.html
syms x
diff((1/2)*x*y*exp(2*y),y)
%No3d http://www.mathworks.com/help/symbolic/diff.html
syms x y
diff(diff(exp(-x^3-y)))

Enkripsi Citra menggunakan javax.crypto


kali ini kita akan mencoba mengenkripsi citra menggunakan javax.crypto, beberapa library lainnya juga kita gunakan untuk menunjanng agar data berupa image dapat di enkripsi. Salah satu source code yang tersedia di internet adalah sebagai berikut http://www.theinsanetechie.in/2011/09/java-data-encryption-standard-des.html

package dataencryptionstandart;

import java.io.File;  
import java.io.FileInputStream;  
import java.io.FileNotFoundException;  
import java.io.FileOutputStream;  
import java.io.IOException;  
import java.io.InputStream;  
import java.io.OutputStream;  
import java.security.InvalidKeyException;  
import java.security.NoSuchAlgorithmException;  
import javax.crypto.BadPaddingException;  
import javax.crypto.Cipher;  
import javax.crypto.IllegalBlockSizeException;  
import javax.crypto.KeyGenerator;  
import javax.crypto.NoSuchPaddingException;  
import javax.crypto.SecretKey;  
  
/** 
 * 
 * @author dhanoopbhaskar 
 */  
public class desimage {  
  
    KeyGenerator keyGenerator = null;  
    SecretKey secretKey = null;  
    Cipher cipher = null;  
  
    public desimage() {  
        try {   
            keyGenerator = KeyGenerator.getInstance("DES");  
            secretKey = keyGenerator.generateKey();  
            cipher = Cipher.getInstance("DES");  
        } catch (NoSuchPaddingException ex) {  
            System.out.println(ex);  
        } catch (NoSuchAlgorithmException ex) {  
            System.out.println(ex);  
        }  
    }  
  
    public static void main(String[] args) {  
        String fileToEncrypt = "5.png";  
        String encryptedFile = "encryptedFile.png";  
        String decryptedFile = "decryptedFile.png";  
        String directoryPath = "/media/ratjoen/javaFiles/Izhobrazhenie_KriptografiyV3.0L/";  
        desimage encryptFile = new desimage();  
        System.out.println("Starting Encryption...");  
        encryptFile.encrypt(directoryPath + fileToEncrypt,  
                directoryPath + encryptedFile);  
        System.out.println("Encryption completed...");  
        System.out.println("Starting Decryption...");  
        encryptFile.decrypt(directoryPath + encryptedFile,  
                directoryPath + decryptedFile);  
        System.out.println("Decryption completed...");  
    }  
  
    /** 
     *  
     * @param srcPath 
     * @param destPath 
     * 
     * Encrypts the file in srcPath and creates a file in destPath 
     */  
    private void encrypt(String srcPath, String destPath) {  
        File rawFile = new File(srcPath);  
        File encryptedFile = new File(destPath);  
        InputStream inStream = null;  
        OutputStream outStream = null;  
        try {  
            /** 
             * Initialize the cipher for encryption 
             */  
            cipher.init(Cipher.ENCRYPT_MODE, secretKey);  
            /** 
             * Initialize input and output streams 
             */  
            inStream = new FileInputStream(rawFile);  
            outStream = new FileOutputStream(encryptedFile);  
            byte[] buffer = new byte[1024];  
            int len;  
            while ((len = inStream.read(buffer)) > 0) {  
                outStream.write(cipher.update(buffer, 0, len));  
                outStream.flush();  
            }  
            outStream.write(cipher.doFinal());  
            inStream.close();  
            outStream.close();  
        } catch (IllegalBlockSizeException ex) {  
            System.out.println(ex);  
        } catch (BadPaddingException ex) {  
            System.out.println(ex);  
        } catch (InvalidKeyException ex) {  
            System.out.println(ex);  
        } catch (FileNotFoundException ex) {  
            System.out.println(ex);  
        } catch (IOException ex) {  
            System.out.println(ex);  
        }  
    }  
  
    /** 
     *  
     * @param srcPath 
     * @param destPath 
     * 
     * Decrypts the file in srcPath and creates a file in destPath 
     */  
    private void decrypt(String srcPath, String destPath) {  
        File encryptedFile = new File(srcPath);  
        File decryptedFile = new File(destPath);  
        InputStream inStream = null;  
        OutputStream outStream = null;  
        try {  
            /** 
             * Initialize the cipher for decryption 
             */  
            cipher.init(Cipher.DECRYPT_MODE, secretKey);  
            /** 
             * Initialize input and output streams 
             */  
            inStream = new FileInputStream(encryptedFile);  
            outStream = new FileOutputStream(decryptedFile);  
            byte[] buffer = new byte[1024];  
            int len;  
            while ((len = inStream.read(buffer)) > 0) {  
                outStream.write(cipher.update(buffer, 0, len));  
                outStream.flush();  
            }  
            outStream.write(cipher.doFinal());  
            inStream.close();  
            outStream.close();  
        } catch (IllegalBlockSizeException ex) {  
            System.out.println(ex);  
        } catch (BadPaddingException ex) {  
            System.out.println(ex);  
        } catch (InvalidKeyException ex) {  
            System.out.println(ex);  
        } catch (FileNotFoundException ex) {  
            System.out.println(ex);  
        } catch (IOException ex) {  
            System.out.println(ex);  
        }  
    }  
}  

namun hasil yang diharapkan kurang sesuai dengan yang saya inginkan dikarenakan hasil enkripsi tidak dapat dibuka
Screenshot from 2016-01-21 15:55:16

mengapa hal tersebut terjadi, kita bisa lihat detailnya dalam hex menggunakan xxd pada linux command

File asli:
Screenshot from 2016-01-21 15:56:37

File terenkripsi
Screenshot from 2016-01-21 15:58:09

dari capture hex tersebut kita bisa lihat di baris pertama bahwa 8950 yang merupakan extensi dari .PNG juga ikut terenkripsi menjadi 0eda hal tersebut menyebabkan tidak dapat nya komputer mendisplay citra yang telah terenkripsi. namun saat sudah file yang telah terdekripsi dapat terdisplay karena hex kembali seperti semula

bagaimana caranya agar kita tidak mengenkripsi file format header, tetapi hanya nilai pixel nya?

How Do You Know the Policy Files Really Behave as Sun Says They Do?


When you look at the history behind the JCE, it is easy to see why some people would be inclined to feel it is all a conspiracy by Sun, the U.S. government, the UN, the Illuminati, the Greys, or some other “organization” and that anything running under the JCE should not be trusted, as you cannot see the code that deals with key strength and various other control mechanisms that the policy files allow you to turn on or off. If this is a concern for you, remember, just as you would test a hardware cryptography adapter by comparing its outputs for given inputs against the outputs produced by an alternative implementation for the same set of outputs, you can also treat the JCE and the underlying provider as a black box and perform the same tests. As it happens the Bouncy Castle provider was first developed as a lightweight library for MIDP, so if you are feeling really enthused, you can start by verifying that the Bouncy Castle provider and the JCE is producing the same output as its lightweight equivalent. It is true that in matters like these you should not take what people tell you at face value, but always remember you can test and investigate the truth of other people’s claims yourself.

David Hook-Beginning Cryptography with Java-Wrox (2005)

Buku Cryptography for Internet and Database Applications


salah satu buku tentang kriptografi yang recommended Cryptography for Internet and Database Applications Developing Secret and Public Key Techniques with JavaTM oleh Nick Galbreath,

berikut daftar isi dari buku tersebut

Chapter 1 Bits and Bytes
General Operations
Number Bases
Bits and Bytes
Signed Bytes
Bitwise Operators
Complementation or Bitwise NOT
Bitwise AND
Bitwise OR
Bitwise Exclusive OR (XOR)
Left-Shift
Right-Shift
Special Operations and Abbreviations
Packed Words
Integers and Endian Notation
Java Numerics
Basic Types
Type Conversion
Unsigned to Signed Conversions
Overflow
Arrays
Numeric Classes
Booleans and BitFields
Chars
Working with Bytes
Sign Problems
Conversion of Integral Types to Byte Arrays
Converting to Hex Strings
BigInteger
Creating and Converting
BigInteger and Cryptography
Secret Methods in BigInteger

Chapter 2 Secret Key Cryptography
Symmetric Block Ciphers
Cipher Properties
Security Properties
Brute-Force Attacks
Other Attacks
Common Block Ciphers
Data Encryption Standard (DES)
Triple DES
Blowfish
IDEA
RC5
Rijndael and the Advanced Encryption Standard (AES)
Twofish
RC6
Ciphers You Shouldn’t Use
Password XOR Schemes
Classical Cryptography
ROT 13
Padding
Fixed-Value Padding
Random Padding
PKCS Padding
Modes of Operations
Initialization Vectors
Electronic Codebook Mode (ECB)
Cipher Block Chaining Mode (CBC)
Cipher Feedback Mode (CFB)
Output Feedback Mode (OFB)
Counter Mode (CTR)
Propagating CBC (PCBC) Mode
Key Wrapping
Triple DES KEY Wrapping
AES Key Wrapping
Turning Passwords into Keys
Elliptic Curves
Underlying Mathematics: Elliptic Curves
The Algorithm
Standards and Practice
Other Public Key Cryptographic Systems
Rabin Cryptosystem
NTRU

Chapter 4
Summary
Random Numbers
Randomness and Security
Testing for Randomness
FIPS 140-2 Requirements
Pseudorandom Number Generators
Cryptographic PRNG
SHA-1 PRNG
Cipher-CBC or ANSI X9.17
FIPS 186
Blum-Blum-Shub
Stream Ciphers
One-Time Pads
RC4 or ArcFour
Using Randomness
Generating Random Numbers for Gaming
Generating Random Numbers in a Range
Shuffling
Generating Random Permutations
Small Permutations
Large Fixed Permutations
Random Sampling
Accessing Entropy
OS Services
Win32 CryptoAPI CryptGenRandom
/dev/random and friends
Userland Services
Entropy Generating Daemon (EGD)
PRNGD
Yarrow and EGADS
TrueRand Library
Remote Services
RAND Corporation
HotBits
Random.org
LavaRnd
Java and Random Numbers
Random and SecureRandom
java.util.random
java.security.SecureRandom
Developer Issues
Reseeding
Collecting Entropy
An Entropy Pool Implementation
Basic System State
Thread Schemes
Reading External Sources
Application Events
User Events

Chapter 5 Java Cryptography
Organization
Providers and Engine Classes
Parameters, Keys, and Certificates
Error Handling
Providers
Standard Names
Standard Sun and SunJCE Providers
Other Providers
Initializing Providers
Writing Your Own Provider
Core Engine Classes
MessageDigest
Digest Streams
MAC
SecureRandom
Ciphers
Additional Cipher-Related Objects
Signatures
SignedObject
Key Agreement Protocols
Parameters, Keys, and Certificates
Algorithm Parameters
AlgorithmParameters
AlgorithmParameterGenerators
Keys
Secret Keys
Public/Private Keys
Encoding and Encrypting Keys
Summary 202

Chapter 6 Small Message Encoding and Encryption
Preprocessing 203
Converting Digits into Bytes
7-bit to 8-bit Compression
General Compression and java.util.zip.Deflate
Adding Check and Parity Bits
Small Message Encryption
Single-Block Encryption
n-Block Encryption
Very Small Message Encryption
XOR Tables
Small Codebooks
RC5-16/16
Small Message Encoding
Encoding for Customer-Usable Data
Capacity and Range
Selecting a Base Representation
Selecting Base Alphabets
Mixed Bases and Alphabets
Adding Check Digits
Encoding for Machines and Customer-Visible Applications
Base 64
Base 85
Base 128 and Java Source Encoding

Chapter 7 Application and Data Architecture
Database Architecture for Encrypted Data
Selecting a Cipher
Secret or Public?
Cipher Selection
Data
Passwords
Challenges and Responses
Payment, Credit Card, and Other Account Numbers
Social Security Number (U.S.)
Birthdates and Birthdays
Last Name
Searching, Indexing, and Constraints
Removing Randomness
Deterministic Key Selection
Indexing and Hashing
Uniqueness Constraints
Asymmetric Data Usages
Null Values and Database Applications
Secure Memory Management in Java
Smart Array Classes
Char Arrays
Using SecureRandom
Secret Key Management
Secret Key Data
Key Generation
Key Encryption
Storage
Key Access and Distribution
Using Keys with Ciphers and MACs
Passwords
Startup Passwords
Member Names and Passwords
Selecting Passwords
Member Login, Success and Failure
Changing Passwords and Challenges
Web-Based Password Entry
Generating New Passwords
Member Names
Logging
Embedded-Encryption Logging
Fully Encrypted Log Files
Public Key Logging
Split Log Files
Network-Based Logs
Cryptographic Tokens and Applications
Token Design
Expirations and Time Quantization
Creating the Security Bits
URL Tokens
Tamper-Evident URLs
Protecting Static Content
A Simple URL MAC Implementation
Fast Query String Parsing
URL Encryption
Very Short URLs
Cookie Tokens
Detecting Cookie Capability
Cookies and Authentication
Tokens for Access Control
Buy-on-Demand Systems
Multiple Key Systems
Trials and Expirations
Decimal and Monetary Computations
Doubles and Floats
BigDecimal
Rounding
BigDecimal and Mathematics
BigDecimal Alternatives and Wrappers
Usage and Storage