| | |
Need Help with a part of my encryption program PLEASE!
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
Hi all! I am creating a program to encrypt files in Rijndael 64 bit encryption. I am having a problem with one of the aspects i want to include in my code. It sounds very basic maybe but i have tried many things and somehow i can't seem to figure out why i can't solve the problem.
Ok you might be wondering what the problem is! well its simple read the code elow and then, i will explain my dilema, or even better if you are good enough you'll find out on your own.
Alright, now guys, the problem is that, i have 2 text boxes, one text box to enter key and the other to confirm the key chosen.
I have code there will verify both keys in both text boxes and give out a message box that tell you if they are not the same.
All that is great! But when it comes to encrypt and both keys don't match, it gives out the warning message but keeps on encrypting using the confirm key text box through this code:
I had no choice on choosing one box as the password, or else the program itself woudln't work!
Now to prevent the encryption when you enter to keys that do not match, i put this code that just creates an error.
Would there be a way to overcome this code and actually make the program STOP encrypting if the keys are not equivalent. It would be great if someone can solve this problem of mine. And if you can there is another problem. If you uys got time and want to take a shot at it, its up to you.
I decided not to include a progress bar thinking it would take too much time and code to be able to make that thing work so i decided the do soething a bit more primitive if you like. I decided to make a label that will change text when you go through the steps of encryption. I also wanted to change the text of the label to write "processing..." Will encrypting, that thing the program kinda stops responding while encrypting and does not display the change in label. I was wondering if there was a way of overcoming that situation with some code.
Well thats it folks, i hope you guys can help with my dilemas! Anyways take care! and hope to hear from you guys soon! Thanks in advance
Crypter
Ok you might be wondering what the problem is! well its simple read the code elow and then, i will explain my dilema, or even better if you are good enough you'll find out on your own.
C# Syntax (Toggle Plain Text)
private void button3_Click(object sender, System.EventArgs e) { if (textBox2.Text != textBox3.Text || textBox3.Text == "") { MessageBox.Show("The passwords you chose do not match or text boxs are empty! Type the new password again", "Error"); Thread.CurrentThread.Start(); } LabelChange(); string encType = comboBox1.SelectedItem.ToString(); switch(encType) { case "Rijndael 64 bits": password = textBox3.Text; EncryptFile1(); break; default: Close(); break; } }
Alright, now guys, the problem is that, i have 2 text boxes, one text box to enter key and the other to confirm the key chosen.
I have code there will verify both keys in both text boxes and give out a message box that tell you if they are not the same.
All that is great! But when it comes to encrypt and both keys don't match, it gives out the warning message but keeps on encrypting using the confirm key text box through this code:
C# Syntax (Toggle Plain Text)
password = textBox3.Text;
I had no choice on choosing one box as the password, or else the program itself woudln't work!
Now to prevent the encryption when you enter to keys that do not match, i put this code that just creates an error.
C# Syntax (Toggle Plain Text)
Thread.CurrentThread.Start();
Would there be a way to overcome this code and actually make the program STOP encrypting if the keys are not equivalent. It would be great if someone can solve this problem of mine. And if you can there is another problem. If you uys got time and want to take a shot at it, its up to you.
I decided not to include a progress bar thinking it would take too much time and code to be able to make that thing work so i decided the do soething a bit more primitive if you like. I decided to make a label that will change text when you go through the steps of encryption. I also wanted to change the text of the label to write "processing..." Will encrypting, that thing the program kinda stops responding while encrypting and does not display the change in label. I was wondering if there was a way of overcoming that situation with some code.
Well thats it folks, i hope you guys can help with my dilemas! Anyways take care! and hope to hear from you guys soon! Thanks in advance
Crypter
:eek: Come and visit SharpCreativity.com :eek:
you need braces:
Which COULD be a source of the problem.
As for the mis-matched keys what about:
as a framework?
C# Syntax (Toggle Plain Text)
switch(encType) { case "Rijndael 64 bits": { password = textBox3.Text; EncryptFile1(); } break; default: Close(); break; }
Which COULD be a source of the problem.
As for the mis-matched keys what about:
C# Syntax (Toggle Plain Text)
if keys are equal encrypt else { warning dont encrypt }
http://sales.carina-e.com
no www
no nonsense
coming soon to a pc near you! :cool:
no www
no nonsense
coming soon to a pc near you! :cool:
![]() |
Similar Threads
- Speed up my encryption program. (C++)
- Need help! with encryption program (C++)
- encryption program (C++)
- How to create SHA1 Encryption program (VB.NET)
Other Threads in the C# Forum
- Previous Thread: Comparing Strings in C#
- Next Thread: Can anyone help?
| Thread Tools | Search this Thread |
.net access ado.net algorithm array backup barchart bitmap box broadcast buttons c# check checkbox client combobox control conversion csharp custom database databasesearch datagrid datagridview datagridviewcheckbox dataset datetime degrees development draganddrop drawing dynamiccreation encryption enum equation event excel file form format formatting forms function gdi+ httpwebrequest image index input install interface java label list listbox mandelbrot math mouse mouseclick mysql namevaluepairs operator path photoshop picturebox pixelinversion post powerpacks programming property radians regex remote remoting resource restore richtextbox server sleep socket sql statistics stream string table text textbox thread time timer update usercontrol validation visualstudio wait webbrowser windows winforms working wpf xml





