Christopher Chan

Greenhorn
+ Follow
since Jul 10, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Christopher Chan

Campbell Ritchie wrote:Welcome to the Ranch

I have added some new lines to your code because long lines are difficult to read. I shall move this discussion because it is too difficult for "beginning".



much thanks
13 years ago

James Sabre wrote:One can RSA encrypt the whole file by breaking the file into sections shorter than the RSA modulus (-11 bytes if one uses PKCS1 padding) but this is very very very slow. The standard approach to RSA encryption of files of any length is to use a hybrid approach. One uses a symmetric encryption (AES, Blowfish , DES etc) to actually encrypt the data using a random 'session' key and one only uses RSA to encrypt the session key. The encrypted file then consists of the concatenation of the encrypted session key and the symmetric encrypted file content. To decrypt one just extracts the encrypted session key, RSA decrypts it then using the symmetric algorithm decrypts the file content using this session key.

There is a good description of the approach in section 13.6 of "Practical Cryptography" by Ferguson and Schneier. PGP uses this general approach but the detail differs from that described in section 13.6 .



i have considered that but my supervisor is adamant on having rsa by itself. mind advising on how to split and recombine? much thanks
13 years ago
Hey guys i need to encrypt FILES OF ANY EXTENSION using RSA without a size limit.
I know RSA isn't suppose to be used for large files but my supervisor is insisting on it.
Can you guys please enlighten me on how to do it? much thanks in advance.


This is the code i used to encrypt and decrypt. it allows me to encrypt and decrypt small text files, however i am unable to encrypt big files like pdf files, the program returns an empty encrypted files. i have done some research on forums and some people reccommend using byte by byte encryption or split the file and recombine. please advise on how to code.
13 years ago