Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C Assignment

Options
  • 18-11-2003 7:12pm
    #1
    Registered Users Posts: 574 ✭✭✭


    Hey guys,

    in have a project to do on encryption and i dont even know where to start. for some of ye it is prbably simple but for me it aint.

    would appreciate it if anyone could give me some help or pointers with it

    thanks.

    Encryption.

    The goal of this assignment is to design a program to encipher data safely. It should use a large number of iterations rather than a complicated mathematical operation.
    This program should be able to encrypt characters so they are unrecognisable. It should also be able to decrypt the encoded characters to give you back the original data.

    Ask the user to input text to be encrypted. Read this into an array. Ask the user to input 4 separate keys which are used for the encryption or decryption. Data to encrypt is stored in a character array. It is then encrypted 2 characters at a time, using the four keys read in and stored in a new array.

    Encrypt Routine
    while (n-->0) {
    sum += delta ;
    y += (z<<4)+k[0] ^ z+sum ^ (z>>5)+k[1] ;
    z += (y<<4)+k[2] ^ y+sum ^ (y>>5)+k[3] ;
    }
    v[0]=y ; v[1]=z ;

    Decode Routine
    while (n-->0)
    {
    z-= (y<<4)+k[2] ^ y+sum ^ (y>>5)+k[3] ;
    y-= (z<<4)+k[0] ^ z+sum ^ (z>>5)+k[1] ;
    sum-=delta ;
    }


Comments

  • Registered Users Posts: 19,396 ✭✭✭✭Karoma


    1) go to library
    2) read books on C

    or alternatively, read over the lecturers notes.

    the hard bit is done for you. the rest of just reading in,etc. Any book will cover this.


  • Registered Users Posts: 2,281 ✭✭✭DeadBankClerk


    That project is not on encryption, the encryption part is done for you.

    The project is on basic io and program flow.


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    Agreed. My four year old nephew could do that. Students need to stop asking people to do their homework assignments!@# GAH!


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    Why not be original and implement the whole thing in inline asm?


  • Registered Users Posts: 10,846 ✭✭✭✭eth0_


    Originally posted by sjones
    Agreed. My four year old nephew could do that. Students need to stop asking people to do their homework assignments!@# GAH!

    My thought exactly...


  • Advertisement
  • Registered Users Posts: 2,281 ✭✭✭DeadBankClerk


    IO and program flow should be chapters one and two of your course text book.


  • Registered Users Posts: 7,411 ✭✭✭jmcc


    Originally posted by DeadBankClerk
    That project is not on encryption, the encryption part is done for you.

    The project is on basic io and program flow.

    Definitely. It is a simple case or writing the routines to read and write data and to implement a bit of pseudo-code as the algorithm. It isn't really about encryption (that algo is not something that could be used to encrypt data safely in the real world). Just approach it in a modular fashion:

    select option: encrypt or decrypt;
    user selects e or d;
    read the user input data;
    if {e} use the encryption algo;
    if {d} use the decryption algo;
    process the user input data;
    output the processed user data;
    end;

    Regards...jmcc


Advertisement