Security Software review and downloads
  • Home
  • Spyware & Spyware Remover
  • Registry & Registry Cleaner
  • Firewall
  • Hacked
  • Uninstall & Uninstaller
  • Antivirus

I am disturbed! by this encryption thing in c#?

September 29th, 2008 · 2 Comments

You guys how are you?

Me i am not fine because of

1. I am trying to read data from a file
2. encrypt that data
3. disply the encryptd data on the console
4. How??? using the TrippleDES Algorithm
——————————————-
Problem:

1. suppose the file has the content hallo, or jane or 123 ie; few character, then NOTHING IS ENCRYPTED, I GET NO OUTPUT WHATSOEVER.

2. but when file has the content like “i am really getting pisssed off!” ie; long text; the D**N thing displays something!!

3. When i decrypt using simillar code, The last few character of the orginal text dont show; ie partial decryption.

SO PLEASE SOMEONE HELP!
IN THE MEANTIME, I WILL GO BUY PAIN KILLERS TO CALM DOWN THIS HEADACHE!

Below is my code
——————————–
using System;
using System.Security.Cryptography;
using System.IO;
using System.Text;

namespace TRIPPLEDES
{

class FileCipherer
{

[STAThread]
static void Main(string[] args)
{

System.IO.StreamReader inputstream = new StreamReader(new FileStream(”C:/data.txt”,FileMode.Open));
byte[] data=ASCIIEncoding.ASCII.GetBytes(inputstream.ReadToEnd());
System.Security.Cryptography.TripleDES tdes=System.Security.Cryptography.TripleDESCryptoServiceProvider.Create();
tdes.Key=ASCIIEncoding.ASCII.GetBytes(”12345678!@#$%^&*”);
tdes.IV=ASCIIEncoding.ASCII.GetBytes(”!@12nhuo”);
tdes.Mode=CipherMode.CBC;
System.Security.Cryptography.ICryptoTransform encryptor=tdes.CreateEncryptor();
System.Security.Cryptography.CryptoStream tdes_stream = new CryptoStream(Console.OpenStandardOutput(),encryptor,CryptoStreamMode.Write);
tdes_stream.Write(data,0,data.Length);
Console.WriteLine(”Completed!”);

}
}
}

Related posts:

  • How secure is this c# encryption algorithm? (if a salt were used)?
  • byte[] bytes = ASCIIEncoding.ASCII.GetBytes(textBox1.Text); int hash = 1; for (int...
  • I am working on an C++ encryption program and I can use some help?
  • Develop a program that performs simple cryptography. The program will allow the user to...
  • How do I break a Symmetric Encryption scheme where the Keyphrase is simply added to the Cleartext?
  • The encryption scheme takes the ASCII values of the characters in the Keyphrase and the...
  • Simple Java String Encryption?
  • So I recently made a fun little game of blackjack using java and swing and all that. I...
  • Questions about encryption-security?
  • I made an encryption program. But I have a few questions (not programming related) 1)...
  • Questions about encryption-security?
  • I made an encryption program. But I have a few questions (not programming related) 1)...
  • Understand encryption code?
  • Ok. I need to understand how the following code works. I then need to comment it to show...
  • php encryption?
  • Hello all, I am designing a website and need to encrypt some data. I know how to encrypt...
  • What kind of web-based encryption uses 101 characters?
  • MD5 for example, uses 32 character strings. What im looking at, it encrypts file...
  • Hacking OpenSSL?
  • The open-source tools tcpflow and netcat are very useful for inspecting *unencrypted*...

    Tags: Encryption


    2 responses so far ↓

    • 1 STARBUCKS RULES!!! // Sep 29, 2008

      You need to calm down

    • 2 Rah-Mon Heur // Sep 29, 2008

      When you paste code into a yahoo question, you need to format it so that the lines fit otherwise they are truncated and we can’t read (and try) your code.

      I suggest you re-post your code splitting the lines so that every line fit.

      As for your problem, I’m not familiar enough with those functions to tell you exactly where the problem is, but in both case it look like either the buffer sent to the encrypting function is incomplete, or most probably the resulting string is not flushed to disk completely before it is displayed, truncating the last data that are still in internal buffer.

    Leave a Comment

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word

    Tags: Email Spam Uninstall spyware Security Software Trend Micro Registry Cleaner Pc Tools Norton Nod32 Kaspersky Internet Security Hacked Firewall Computer Security Avg Avast Antivirus Ad Aware Monitoring Software Encryption Backup


    A Slow System?
    Harassed by DLL errors?
    Plagued by constant Blue Screens?
    Receiving error messages and don't know why?

     
    • Most popular Software downloads

      • Pctools
      • kaspersky
    About | Contact Us | Old Sitemap Security Software review and download . All rights reserved PoweredBy Yahoo!API.