I need some help as I dont know where to start. I need to create a unix decryption application.
The information I have been given is this so far:
the specification of the encryption process is:
NET 2 Cryptography classes.
RijndaelManaged encryption algorithm
SHA512Managed class for hashing keys with a blocksize of 128 and a 32 byte key. The HashSize property of the algorithm is 512 and it generates a 64 byte hash key, but then it only uses the first 32 bytes as the key.
not sure where i need to start. Can someone point me in the right direction please.
Looks to me like you should implement the AES-256 symmetric encryption algorithm and the SHA-512 secure hashing algorithm, although the latter uses no key in any way.
Now the question is why you were given this assignment unless your employer/professor assumes that you know that stuff.
I'd suggest you use either your distributions package manager (yum/apt-get/...) to install this module, or the CPAN command line perl -MCPAN -eshell to install Perl modules, as both will take care of any dependencies.
OK, have now install module and correct version of Perl.
But am now totally stuck.
Reading "if you can use perl, CPAN module Crypt::CBC would be helpful" it does not really give me an example on how to decyrpt a file for my specifications. any ideas?
SHA512Managed class for hashing keys with a blocksize of 128 and a 32 byte key. The HashSize property of the algorithm is 512 and it generates a 64 byte hash key, but then it only uses the first 32 bytes as the key
i need to decrypt a file that uses that specification
The .NET Framework RijndaelManaged Class simply accesses the managed version of the .NET Framework Rijndael algorithm.
Rijndael was the winner of the NIST competition to select the algorithm that eventually become AES. There are however some differences between Rijndael and the official FIPS-197 specification for AES which was first published in 2001.
Rijndael allows for both key and block sizes to be chosen independently from 128, 160, 192, 224, 256 bits and the key size does not have to match the block size. FIPS-197 selected a subset of Rijndael and specifies that the block size must always be 128 bits and that the key size may be either 128, 192, or 256 bits (AES-128, AES-192 and AES-256)
Since .NET RijndaelManaged is an implementation of Rijndael, it allows you to select different block sizes (both block and key sizes must be either 128, 192, or 256 bits as 160 and 224 bit are unsupported.) Also .NET RijndaelManaged implementation adjusts block size to match the feedback size in CFB mode, i.e. if you use CFB (and I believe OFB) and a block size of 128 bits, but a feedback size which is not 128 bits you again will not be compatible with AES. As far as I know .NET RijndaelManaged is not FIPS certified.
I am not sure what you mean by .NET SHA512Managed generating "a 64-byte hash key but then it only uses the first 32 bytes as the key" Do you mean, as I suspect you mean, that Rijndael is using a 256-bit key? If this is the case any AES-256 decrypt routine will work for you so long as you know the symmetric key (typically derived from a passphrase.)
You need to clarify block and key sizes if you expect us to be able to help you.