Finding a Key - C

This is a discussion on Finding a Key - C within the C Programming forums, part of the General Programming Boards category; Hi, I was wondering would anybody have any ideas on my problem. I am trying to find a key which ...

  1. #1
    Unregistered
    Guest

    Post Finding a Key - C

    Hi,
    I was wondering would anybody have any ideas on my problem.

    I am trying to find a key which encrypts a plaintext byte. I am using a limited exhaustive search and have reduced the number of bits need to be flipped.

    here is my variable.

    #define WORD16 unsigned short

    WORD16 key[1]={0xffff};

    now...is there anyway I can cycle through all possible values for this key and test the output. The key is in hex. At the moment I am using a counter, converting it to hex and it is getting rather messy!!! Basically is there an automated way I can get all possible values up to the hex value 0xffff.

    Any suggestions would be very much appreciated....
    thank you!!!

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,496
    > now...is there anyway I can cycle through all possible values for this key and test the output.
    A loop and an if statement seem like a good place to start.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 12:48 PM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 09:00 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21