Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Is there an algorithm or technique to encrypt all the datatypes such as (video , image , text , fax, audio ,file,etc...) -one algorithm encrypt every thing-?

also if I try to build such this algorithm ,what is the problems that may i face? such as server powerful or processing time, etc ?


Clarification: In our company some people have the capabilities to make encryption algorithms. I am wondered if they make one algorithm to encrypt everything, what will be the server demand, what is the complexity? Why do some people say if you try to encrypt every thing in one algorithm you will have a very complex system?

share|improve this question
2  
Typical encryption algorithms operate on sequences of bytes. All of those data-types can be serialized to bytes, so the all can be encrypted with any common algorithm. The ciphertext won't conform to typical video/audio/... formats. It's just a bunch of bytes. –  CodesInChaos Jan 7 at 9:15
    
if i do the encryption as you said , if it is video can i reversed it (decry pt it) from the cyphertext? –  khalid jarrah Jan 7 at 9:23
1  
To be classed as 'encryption' the process must be efficiently reversible. As CiC says, it doesn't matter what the original bytes represent to the user: To the crypto they're just bytes –  figlesquidge Jan 7 at 9:26

1 Answer 1

Is there an algorithm or technique to encrypt all the datatypes

Most encryption algorithms simply encrypt binary data, meaning they don't care what the data represents to the user. So, for example AES (under a suitable mode-of-operation depending on your actual use-case) would solve your question.

You mention in your clarification that someone has said an implementation that can encrypt any file will be more complicated than one that just encrypts a single file-type. This is not correct.

if I try to build such this algorithm ,what is the problems that may i face?

You would face lots of issues, for some of which see this. The short answer is making a crypto algorithm is very hard indeed, and lots of very experienced cryptographers have created schemes that turned out to have catastrophic security flaws.

The problem is that creating a 'new' encryption scheme is hard to do, and unless done very careful and tested incredibly thoroughly. For example, AES was tested through 3 years of competition, then 10 years of real-world-use. No matter how talented your crypto programmers are, if they try to generate their own schemes or implementations there is a high risk that something will be done incorrectly (such as a weakness in the scheme, or an implementation that is susceptible to side-channel attacks).

Much better would be to use a pre-built crypto library.


Interpreting your question in a different way, you might be interested in Format Preserving Encryption (FPE), which combines encryption with a reg-ex system such that the encryption of a file remains a valid file of the same format.

share|improve this answer
    
so I think you cannot build such this algorithm , if u make a specific algorithms for every type ,so it will be more secure –  khalid jarrah Jan 7 at 9:28
1  
Sorry Khalid, I don't understand your question. Encryption algorithms for encrypting binary data already exist and have been extensively studied. Examples such as AES are believed to be secure and used everywhere. –  figlesquidge Jan 7 at 9:31
    
I will give you the problem well, in our company some people have the capabilities to make encryption algorithm, I am wondered if they make one algorithm to encrypt every thing so what will be the server demand , what is the complexity ,why some people say if you try to encrypt every thing in one algorithm you will have a very complex system ? –  khalid jarrah Jan 7 at 9:36
    
I've updated my answer (and your question) accordingly –  figlesquidge Jan 7 at 10:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.