I have to create a program that encrypts a file by taking each byte and increment it.
The problem is that the program should use multithreading to do the actual encrypting. The number of threads is variable, the user enters them in a Edit Control, and those “x” number of threads, simultaneously must encrypt the file.
What I’ve done so far is that I opened the file in binary mode and encrypt it by incrementing each byte in the file. So far so good, but now I can’t figure out how to create those threads and how should they encrypt the file simultaneously … a little help would be awesome.
Here is the code I done so far: when the user pushes the Ok button (the file has been selected by the user in a previous step), the selected file is encrypted
I don't think that encrypting of one file should be concurrently, because in this case you have to synchronize reading/writing from/to files and streams. And as I think in this case you will create some treads, but your treads will not work concurrently. But you can very easy to encrypt some files simultaneously and in this case it will be very useful.