Thread: Encryption algorithyms

  1. #1
    Registered User f0ul's Avatar
    Join Date
    Nov 2001
    Posts
    37

    Encryption algorithyms

    I have noticed a few posts on here recently about encryption and it got me thinking about writing a my own algorithym.

    I know that for an algorithym to be accepted, you need to post both the encrypted text and the algorithym and see if it can be cracked by experts.

    I have a formula in mind and will be working on it in the next few days - does anyone know if there is a standard that is used to test new formulas or would I just post my program with a encrypted text and ask people to decrypt it without knowing the key?

    Surely, with mention of atomic ratiation and the like, there must be a standard to make the work of breaking the encryption more focused? If the key was something silly, (1024 bits of nonsense etc) then people could miss flaws in the actual code because they would be concerntrating on the key and not the message?

    What do you lot think?
    I don't want to belong to any club that'll accept me as a member!

  2. #2
    Registered User toaster's Avatar
    Join Date
    Apr 2002
    Posts
    161
    I think that many people are under estimating that simple techniques of encryption are to be weak. It can take us days, months, or even years to decrypt even the simplest encryptions. Even compression formulas can make encryptions. Not even professional hackers can decrypt something very easily. The choices are endless. Even if the encryption was weak, I doubt the hacker would think this way. However, if a key is some word you can find in a dictionary, then the chances for this material to be decrypted are easier (that's why you have to make passwords or keys hard to guess) since dictionary decryption algorithms (I think that's what they call them) exists. Even so, it takes time to crack it. If you do submit some encrypted text, I don't think many of us would figure it out unless it's some coincidence that we guessed your encryption method correctly. As for simple encryptions, you can even write up some simple program that uses a file (a large file recommended) and use the contents in that file as a key to encrypt a file with it. It's simple to do, but not easy to decipher. Think about it.

    if you need a sample outline of how that encryption algorothm is formed, here it is (I believe this is called the Vigenere Algorithm?):

    get source file (file that is to be encrypted)
    get key file(file that is to be used as a key)
    get optional destination file (if you don't want changes made to the source file.

    read and get single characters at a time from the key file and then you can do something like add the ASCII value of that character to the corresponding character and then subtract 255 from it if it is greater than 255 or just mod it by 255. write this character to either source or destination file. repeat this step until you reach the end of the source file.

    to decrypt it. do the same as above but just subtract the key ASCII value from the key file. if less than zero, add 255 to it.

    just make sure you set the values of the files to type char.

    here's a sample:

    encryption:
    ASCII value of char from key file: 140
    ASCII value of char from source file: 150
    total: 290
    290 MOD 255 = 35 so the encrypted ASCII value is 35.

    decryption:
    ASCII value of char from encrypted file: 35
    ASCII value of char frpm the key file: 140
    35 - 140 = -105
    -115 is negative so -105 + 255 = 150 <- this is the original value

    and of course there are infinite types of encryption out there. choose your defense. also, about that encryption above, for the hacker to decrypt it, it's either the right file is found or by coincidence (just don't use a file that contains text, use a picture or movie file instead).
    Last edited by toaster; 04-20-2002 at 06:27 PM.
    think only with code.
    write only with source.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. help needed with edit control & encryption
    By willc0de4food in forum Windows Programming
    Replies: 2
    Last Post: 03-16-2006, 08:21 PM
  3. abt encryption algorithm
    By purIn in forum C Programming
    Replies: 9
    Last Post: 12-22-2003, 10:16 PM
  4. What's wrong with my Stream Cipher Encryption?
    By Davros in forum C++ Programming
    Replies: 3
    Last Post: 04-18-2002, 09:51 PM
  5. File Encryption & Read/Write in Binary Mode
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 11-30-2001, 06:45 PM