I want to develop a website which will take the files from my computer encrypt it with my key and upload it on cloud which is only for storage purpose and decrypt it after downloading it on my computer. For this which cryptographic algorithm should i use which are available in any crypto libraries.
What you need to do is encrypt the file(s) before uploading it to the cloud provider, and decrypt them on download.
- You do not want to cloud provider to by able to read (decrypt) these files.
- You would like something simple to implement
Use a symmetric algorithm to encrypt the files. The most common secure algorthm is AES
There are many implementations, see AES Implementations
An example is using 7-zip to encrypt the file(s) using AES, then upload them to the cloud server. This is considered secure and should hold up against all adversaries assuming you pick good settings (key length, etc.)
Want Perfect Security?
If you really want to make sure know one could ever see these files you could encrypt them with a One Time Pad, which would make the files mathematically unbreakable ever*, but would give you a key the same size as the files. Not practical normally.
*assuming random key generation
Your need is just for storing the file in the cloud and assuming that the key will always be with you and only you.
Here is the list of algorithms that you can use:
- Triple DES
You can encrypt with anyone of these and upload them to cloud and for decryption, you will only be having the key.
AES is available in any crypto library. Use AES. Or better than that, use a blackbox library like NaCl or libsodium with the defaults, which was designed by a top-notch cryptographer, meaning you don't have to worry about screwing up the implementation which you are indeed quite likely to do if you try and implement this yourself.
The one that fulfills your requirements.
If you just want to upload and download it, don't encrypt it.
If you want to encrypt it because encryption sounds so cool, just XOR it with 01010101b.
If you want to encrypt it to be secure, define what secure means for you.
- Do you want to prevent the cloud provider from automatically analyzing your file?
- Do you want to prevent the cloud provider from decrypting your file now?
- Do you want to prevent the cloud provider from decrypting the files in 1/10/100 years?
- Do you want to prevent powerful governments (e.g. NSA) to decrypt your file now/in 1/10/100 years?
How much CPU resources can you use for encryption?
- Does the hardware you use has support for some encryption like AES-NI?
- Are there legal/regulatory rules you have to comply with?
With the little information you gave, no one can properly answer that question.
If you don't really care, download this report and just pick one cipher at random from page 23 or 27