Any system that has been compromised in any way should have all its cryptographic keys replaced. How to determine if you are vulnerable. Unless you are using hardware cryptographic devices, your keys will most likely be stored as binary files on the system providing the encryption. Can you export the private key or certificate from the store? 2010-9-16 Cryptography we are using AES algorithm to encrypt a message and a part of the message is hidden in DCT of an image; remaining part of the message is used to generate two secret keys which make this system highly secured. Keyword: Cryptography, Steganography, Stego- image, Threshold Value, DCT Coefficient 1.
Cryptographic system implemented in Go language for Cryptography subject in FIB
General info about Go: http://golang.org/
All libraries used can be visited here: http://golang.org/pkg/
Version used: 1.3.3
Once installed, set the variable GOPATH to the main directory of the project
To build the project use
System is the main directory that contains all rellevant files. The previous comand will create anexecutable file in bin
called system
. It will also generate another directory called pkg
where the package inout
will be stored. An overview of the structure:
crypt.go
: Contains all functions for encrypt and decrypt a filekeys.go
: Functions to generate an RSA key and EC keysignature.go
: Functions to sign and verify files with EC and RSA keysmessage.go
: Functions to send and receive a messagemain.go
: Main programinout.go
: Functions to read and write filesEncryption and decryption uses the AES algorithm with blocks of 128 bits operating withcypher block chaining (CBC) with the given key (usually 16 bytes). An IV vector is addedas header and before encryption and after decryption uses padding PKCS #7
Given an integer n, generates an RSA key with n bits in PEM format. Default value is 2048 bits (recommended).Outputs always two files:
If you want to check your generated key you can run in the terminal:
Given a name of a curve (only available to input 256, 384 and 521) generates thatcurve (prime256v1,prime384v1,prime521v1). By default generates prime256v1.
If you want to check your generated key you can run in the terminal:
To list all the curves available in openssl useopenssl ecparam -list_curves
The system can sign with RSA and EC keys. The functions in the main program are with EC.All signatures and verifications use SHA256 hash.
To sign a file is needed to provide its name and the private key. To verify it needs the publickey and also the signature. With EC keys generates two big ints, each one has 256 bits, so thesize of the signature is 64 bytes.
The function that sends a message is provided with the file, a public RSA key (2048 bits) and a private ECkey (P256) for signing purposes. First, signs the file with the private EC key, then appends the signature tothe file and encrypts all with AES with a previously generated random key of 16 bytes. The key used is encryptedwith the public RSA key and added as header.
The function that receives the message does the inverse process. Given the encrypted file, a private RSA key anda public EC key, first takes the first 2048 bits and decrypts them with the private RSA key. Now decrypts the otherpart with the key and separates the message from the signature (Last 64 bytes).