473,412 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Cryptography and Compression

Tom
Hi,

I have a project involves in file compression and
encryption (generate asymmetric key for file transfer).

Which API should I use in C++?

Which good book or online material for this topic?

If there are C, C++, VC++ and C# for selection, which
programming language is the best in this topic?

Thanks for any advice.

Nov 16 '05 #1
3 1903
"Tom" <ke*****@yahoo.com> wrote in message
news:07****************************@phx.gbl...
I have a project involves in file compression and
encryption (generate asymmetric key for file transfer).

Which API should I use in C++?


About a dozen of them. :-)

Seriously, cryptography is a huge, complex topic. Windows has a cryptograpgy
API which allows applications to make use of the features supplied by
cryptographic service providers. There is a base level
provider available in most versions of Windows. Check the docs for
CryptAcquireContext() and follow the links back to the overview. Also check
the Platform SDK and VC++ installations which have some samples.

Regards,
Will
Nov 16 '05 #2
Tom wrote:
Hi,

I have a project involves in file compression and
encryption (generate asymmetric key for file transfer).

Which API should I use in C++?

Which good book or online material for this topic?

If there are C, C++, VC++ and C# for selection, which
programming language is the best in this topic?

Thanks for any advice.


A couple pieces of advice:

1. Get "Applied Cryptography" by Bruce Schneier and read at least the
introductory chapters.

2. Get Crypto++ (http://www.eskimo.com/~weidai/cryptlib.html) if you'd like
a more nuts-n-bolts solution (pick & choose your algorithms & techniques)
than what the Windows Cryoto API provides.

3. You don't want to use an asymmetric cipher for bulk file encryption:
they're much too slow. Instead, what's normally done is the bulk data is
compressed, then encrypted using a symmetric cipher and a random "session
key". The session key is then encrypted with an asymmetric cipher and
appended to the compressed/encrypted file.

-cd
Nov 16 '05 #3
For compression you can use something like zlib:
http://www.gzip.org/zlib

Like Carl noted you will need Symmetric algorithm for the whole file
encryption. Asymmetric is usually limited to small sized blocks anyway and
is suited well for encrypting the symmetric key.

For encryption you can use .NET provided classes, MS CryptoAPI, OpenSSL, or
Crypto++

..NET based solution is very easy and straight forward to use:
http://msdn.microsoft.com/library/en...hyoverview.asp

Another plus for .NET is that it supports AES/Rijndael on all relevant
windows platforms.

With MS CryptoAPI AES comes only with WindowsXP and Windows 2003.
http://msdn.microsoft.com/library/en...phy_portal.asp

There is also a COM based interface over CryptoAPI called CAPICOM:
http://msdn.microsoft.com/library/en..._reference.asp
http://www.microsoft.com/downloads/d...5-ff88ea5896f6
"Tom" <ke*****@yahoo.com> wrote in message
news:07****************************@phx.gbl...
Hi,

I have a project involves in file compression and
encryption (generate asymmetric key for file transfer).

Which API should I use in C++?

Which good book or online material for this topic?

If there are C, C++, VC++ and C# for selection, which
programming language is the best in this topic?

Thanks for any advice.



Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrzej | last post by:
Hi, I have to figure out why we have a problem with special characters in encrypted usernames and passwords. Case: Username: r&bgeorge Password: tigger
0
by: EP | last post by:
I have a WSE server app that uses the <cryptography> element in the configuration (seen below). This worked perfectly in WSE sp1, but when I upgraded to SP2 and then to SP3, I get the following...
1
by: chris.atlee | last post by:
I'm writing a program in python that creates tar files of a certain maximum size (to fit onto CD/DVD). One of the problems I'm running into is that when using compression, it's pretty much...
1
by: muthu | last post by:
Hi, I have two web applications running on my machine.The application is developed using asp.net 1.1 and vb.net.When i try to run both the applications in the same browsers, i get the following...
1
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Hi, everybody here. I am implementing data encryption/decryption, and try to use System.Security.Cryptography.TripleDESCryptoServiceProvider. But I can not find it in MS Visual Studio when I...
20
by: chance | last post by:
Hello, I want to add compression to a memory stream and save it in an Oracle database. This is the code I have so far: //save the Word document to a binary field, MemoryStream dataStream = new...
1
by: Eric Simmons | last post by:
Hello, I am trying to run a .NET 2.0 application that I developed and I am getting the following error: Key not valid for use in specified state I am attempting to retrieve the...
21
by: =?Utf-8?B?VkJB?= | last post by:
I compressed a file with GZipStream class and is larger than the original file.... how can this be?, the original file is 737 KB and the "compressed" file is 1.1 MB. Did i miss something or is...
6
by: andrew | last post by:
Hi, I have a web service application written in C# .NET 1.1 using MD5CryptoServiceProvider.ComputeHash(Byte) The problem is that after a while(web service processes requests) the call throws...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.