1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Encrypt a string in c# windows application

Discussion in 'C, C++, C#' started by kingg, Jun 27, 2014.

  1. kingg

    kingg Newbie

    Joined:
    Apr 6, 2012
    Messages:
    38
    Likes Received:
    1
    I don't want to use encryption algorithm which are inbuilt in c#, is there any way to make custom encryption in c#?

    ANy help regarding this is appreciated.
     
  2. handmadebots

    handmadebots Senior Member

    Joined:
    Nov 8, 2012
    Messages:
    904
    Likes Received:
    204
    Home Page:
    Search on google, you might find some interesting algorithms (not built-in c#).
     
  3. xbyte

    xbyte Regular Member

    Joined:
    Jan 15, 2013
    Messages:
    295
    Likes Received:
    31
    Occupation:
    AccuRanker CEO/Developer
    Home Page:
    You can contact me on skype, i wrote a class for it for a prior project.
    skype : byte-x
     
  4. xbyte

    xbyte Regular Member

    Joined:
    Jan 15, 2013
    Messages:
    295
    Likes Received:
    31
    Occupation:
    AccuRanker CEO/Developer
    Home Page:
  5. botmate

    botmate Newbie

    Joined:
    Jan 28, 2015
    Messages:
    9
    Likes Received:
    0
    PM me your skype, I should be able to help.
     
  6. AutomationSorcerer

    AutomationSorcerer Registered Member

    Joined:
    Apr 25, 2015
    Messages:
    73
    Likes Received:
    66
    Occupation:
    Senior Software Engineer
    Location:
    Ethereal Plane
    Yeah, I'm resurrecting an old thread; but just wanted to add in case anyone else reads this thread.... DON'T. Just.... DON'T.

    Unless you're a cryptography expert (ie. Bruce Schneier and those in his league), the chances of you creating a novel encryption algorithm that isn't breakable by someone experienced doing so in less than a day, is pretty much none.

    If you want to create an encoding algorithm just to make stuff slightly more complicated for people to poke around into your implementation, fine. But the word encryption implies secure; and any custom algorithm you write will almost guaranteed not be secure.

    I'm not a cryptanalyst, but I know enough about encryption to take a whack at breaking whatever it is y'all come up with. I'll do it for fun *shrug*.

    Just use AES/DES/etc for symmetric or RSA for asymmetric. Why roll your own o_O? XOR based algorithms are easily broken by statistical analysis of the resulting cipher text.

    ========

    xbyte's pastebin is an acceptable implementation since it's using TripleDES. Not sure why his example is using a static salt though... check this out for an example of using dynamic salts: ( can't post links yet, defuse/password-hashing on GitHub ).

    Dynamic salts prevents someone from computing the output for value X and using it to find all instances of encrypted X.
     
    Last edited: Apr 25, 2015