CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2020
    Posts
    4

    Help needed for my college project

    I have a college project that involves security encryption - this is what i need:
    1) I want a way to view code for a file (it can be any file: video, document, audio, etc.)
    2) Once I have obtained the code, i will insert characters (randomly generated) in the code (applying my encryption)
    3) A separate file will be generated for the random characters inserted in the code and stored online.

    I will now have a code file containing characters inserted in the code to encrypt it.

    Decrypting:
    I will use the file containing characters inserted in the code to remove the characters inserted in the code (providing the original code)
    The original code can be converted back to the original file for viewing.

    Is there a way of viewing a file in code format and then restore the code back into the file (some kind of decompiler and compiler)

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Help needed for my college project

    What have you written so far?

  3. #3
    Join Date
    Mar 2020
    Posts
    4

    Re: Help needed for my college project

    I have not written any code yet - the problem is how do i view a file in code format? Decompilers change the code format and compiling back does not provide the original file back.

    I have very basic knowledge - how do i go about it. Can someone help for a fee

  4. #4
    Join Date
    Feb 2017
    Posts
    677

    Re: Help needed for my college project

    Quote Originally Posted by ASH110 View Post
    the problem is how do i view a file in code format?
    What do you mean by "file in code format". Any file holds information in some kind of format. Files are viewed with the help of programs targeting specific formats. Most formats are standardized and described in publicly available specifications.

  5. #5
    Join Date
    Mar 2020
    Posts
    4

    Re: Help needed for my college project

    So what you are saying is that for every file type (Mp3, mpeg, MKV, pdf, Word, etc. x 10,000) i have to use a specific format ? - so the only universal format to view the file would be binary - is this correct ?

  6. #6
    Join Date
    Mar 2020
    Posts
    4

    Re: Help needed for my college project

    So in essence i need to decompile the file in binary to work with it or apply my encryption?

  7. #7
    Join Date
    Feb 2017
    Posts
    677

    Re: Help needed for my college project

    Quote Originally Posted by ASH110 View Post
    So in essence i need to decompile the file in binary to work with it or apply my encryption?
    You don't need to do anything special with a file to be able to read its content. In principle a file is just a sequence of bytes, each byte holding 8 bits of information (I'm sure there are exceptions but this is the norm today).

    Every programming language allows you to read a file byte by byte, do whatever you like with each byte and write them back to the same file or to another file you have created. The format is superimposed on top of the sequence of bytes. Each format tells how the bytes (and their bits) are to be interpreted.

    In the simplest case each byte is interpreted according to the ASCII format,

    https://en.wikipedia.org/wiki/ASCII

    It is a text format. It defines each byte to be a symbol of an English language text. There are other text formats for example Unicode where each symbol is stored in several bytes and so allows for a much larger number of different symbols necessary to cover all languages. In yet other formats the bytes are defined to be some mixture of symbols, numbers and pixels which then make up information elements relevant to some application.

    Formats are often layered. For example a format can use ASCII symbols as a bottom layer but also define certain symbol sequences on top that have special meaning such as the start and stop of something.

    ---

    So the format of a file tells how the bytes on the file should be interpreted. The format is not strictly necessary for encryption of the file. To the best of my knowledge most encryption approaches are "format independent" so to speak. They work on the bare bytes of the file oblivious to what meaning they may carry.
    Last edited by wolle; March 15th, 2020 at 02:38 AM.

  8. #8
    Join Date
    Mar 2020
    Posts
    5

    Re: Help needed for my college project

    Decimpliers are useful here. Change one of yours and try out again.

  9. #9
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Help needed for my college project

    Quote Originally Posted by Brian Gimbli View Post
    Decimpliers are useful here. Change one of yours and try out again.
    What is "Decimpliers"?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured