Hi, i am new in this encoding decoding stufs and i have some problem. I work on VS 2012 ASP.NET c#. My problem is that i need to create CheckSum value from some input string. The length of the CheckSum need to be 16 bytes (32 characters) long like this one: "8A303F3E0CB4F8A9CDA5AC120F9B90A4". The encryption need to be done using a pass key for example TEST_PASS and this key will be used latter to be decrypted this hash value.... hope you understand what i ask and what i need pls help me
Look again at the specs for encryption/decryption. That looks trather like a multistep step procedure: - user enters password - system generates salt - system generates hash from salted password and derives both CheckSum and actual password for encryption - system stores salt and CheckSum in the encrypted file - system encrypts input file with the actual password generated above. When you want to decrypt the file, you can check the password by calculating the CheckSum. The decrpytion algorithm might work with a wrong password too, just producing a nonsense output...
First, MD5 is a cryptographics HASH, NOT an encryption.
Second, it's a ONE-WAY hash. There is no such thing as "decrypting a hash". In theory, you cannot get the original content back from a hash value.
Lastly, MD5 is considered broken and should no longer be used in production code. It just doesn't take that much computing power to break it in todays world. Also, two different pieces of content CAN produce the same hash value using MD5!
Use something a bit stronger, like SHA512 instead and use proper salting techniques to make it even harder to break.
Below is a piece of code, where in I am trying to post a file from my pc to remote development server. For some reason it does not seem to be working. I don't see the file on the remote server.
privatevoid button2_Click(object sender, EventArgs e)
FileStream filetoupload = new FileStream("C:\\projects\\testfile.csv", FileMode.Open);
Uri address = new Uri("http://devsrvr/hints/");
HttpWebRequest webreq = HttpWebRequest.Create(address) as HttpWebRequest;
// set type to post
webreq.Method = "POST";
webreq.ContentType = "application/x-www-form-urlencoded";
webreq.Timeout = 15 * 1000;
// data we want to send, which is pretty much a filebyte bytedata = UTF8Encoding.UTF8.GetBytes(filetoupload.ToString());
webreq.ContentLength = bytedata.Length;
using (Stream poststream = webreq.GetRequestStream())
poststream.Write(bytedata, 0, bytedata.Length);
catch (Exception ex)
I'm not surprised it's not working. As a small point, could you please post code that stands a chance of compiling. There isn't a HttpWebRequest.Create - it's WebRequest.Create.
Your problem here is that you are just reading the data into a stream, which you then dispose of. What do you think the stream at the server end is going to do? You actually need something there to take that stream and write it out to a file. That's the part you're missing here.
I was brought up to respect my elders. I don't respect many people nowadays.
I am developing a Designing Application. In this application there is a feature where user can add multiple images on form(can drag here and there).
I have few GIF Images of Cartoons. I want to show them as GIF Only. But when I put image on form it shows White area in blank portion.
I have used Panel and Images are set as Background Image in the Panel.
I think I have not described clearly. Here I have attached image link for more clarification.
In this image background is a Panel(pnlMain) with a Background image. And Spider man is in another panel (panel1) with Background Image in panel1. Spider man image is GIF Image with Transparent area around spider man.
I made simple winform application in C#. I am showing menu options depending upon the mode selection. .i.e. if mode is eng then I am showing all the menus in MDI and if mode is tech then I am hiding some menus of MDI.This is handled in Code.
I am using MSI to create setup.I am using custom dialog box i.e. 2 radio button for mode selection. Now I want install software depeding upon the mode selection. i.e. if I select Eng mode radio button then installer install software with all menus and if I select tech mode then installer install only few menus which is applicable to tech mode.
I dont know how to use custom action so that i can pass the selection option to the exe. Is there any other solution just let me know.
Yes I am passing tech/eng mode values as commadline argument and checked that in Main Method in program.cs. Default is tech mode.
In Installer Project - I set the radio button values and can able to get these values using string myInput1 = this.Context.Parameters["BUTTON1"]; string myInput2 = this.Context.Parameters["BUTTON2"]; Now when I start installer it is showing 2 radio button and in that i want selected radion button value to be passed to exe so that only that exe get installed.