Questions tagged [cryptography]

Cryptography is the practice and study of logical means used to achieve information confidentiality, integrity and authenticity. It covers, among other things, encryption (making some data unreadable except for those who know a given secret element, called a key), data hashing (in particular for password storage) and digital signatures (provable integrity and authenticity with non-repudiation).

Cryptography is about ensuring, in a computerized context, the following properties:

  • confidentiality: some information must be stored or transferred without permitting unauthorized entities to read it;
  • integrity: some information must be stored or transferred without allowing any alteration by an unauthorized entity to go unnoticed;
  • authenticity: some information must be stored or transferred in such a way that the originator of the information can be verified, in a way which unauthorized entities cannot falsify.

"Entities" are persons, roles or systems which are supposed to be distinct from each other according to some definition. Cryptography operates in the logical world of computers, from which the physical world is out of reach; in plain words, anybody can buy a PC, so what distinguishes a user from another (as seen through a network or any other communication protocol) is what that user knows. Cryptography calls such knowledge a key: this is a piece of secret data, which is used as parameter to a cryptographic algorithm which implements a cryptographic property with regards to the key.

For instance, symmetric encryption is about transforming some data (possibly a huge file), using a (normally short) key, into an encrypted form which shows no readable structure anymore, but such that the transformation can be reversed (recovering the original data from the encrypted form) if the encryption key is known. In a way, symmetric encryption concentrates confidentiality into the key, which can be short enough to be manageable (e.g. the key might be memorized by a human being, in which case it is called a password).

The cryptographic algorithms themselves are public, if only because nobody can really tell "how much" a given algorithm is secret, since algorithms are often implemented as software or hardware systems which are duplicated into many instances, and the cost of reverse engineering is hard to estimate. A cryptosystem (combination of an algorithm and its key) is then split into the algorithm, which is embodied as an implementation, and a key, for which security can be quantified (e.g. by counting the number of possible keys of a given length).

Cryptography covers the science of designing cryptographic algorithms (cryptology) and of trying to break them (cryptanalysis); it also encompasses the techniques used to apply the algorithms in various situations, in particular implementation as software, and the related subjects (such as performance issues). Some algorithms consist in the assembly of several sub-algorithms in order to obtain higher level properties (e.g. "a bidirectional tunnel for confidential data with verified integrity and mutual authentication"); they are then called protocols.

Commonly used cryptographic algorithms and protocols include, among others:

  • Symmetric encryption: 3DES, AES, RC4, Blowfish
  • Hash functions: SHA-2 (includes SHA-256 and SHA-512), SHA-1, MD5
  • Hashes for passwords: bcrypt, PBKDF2, crypt (and NOT fast or unsalted raw hash functions)
  • Asymmetric encryption: RSA, ElGamal, some Elliptic curve cryptography algorithms
  • Digital signatures: RSA (similar, but not identical to, the RSA for encryption), DSA (as part of the "DSS" standard), ECDSA
  • Data tunneling: TLS (formerly known as "SSL"; when used to convey HTTP requests, the result is known as "HTTPS"), SSH, IPsec
  • Encrypted and/or signed emails: OpenPGP (standard protocol derived from the original PGP software), S/MIME
  • Certificates: X.509, OpenPGP (certificates are about binding identities to public keys, which are themselves used in asymmetric encryption and digital signatures)

On-topic themes also include password management (storage, verification, entropy, breaking techniques such as rainbow tables...), advanced multi-party protocols (electronic voting schemes, digital cash, anonymous browsing...), usage of existing implementations (libraries, hardware accelerators, smartcards...), and so on.

2356 questions
43
votes
4 answers

What is a cryptographic oracle?

I came across the term "cryptographic oracle" and despite a bit of googling I was unable to come across a clear, concise definition. What is a cryptographic oracle and what does it do? Can anyone give an example?
josh-cain
  • 627
  • 1
  • 7
  • 7
35
votes
2 answers

How to start writing crypto software

This is just an academic question, I do not intend to write my own crypto software. Every time someone asks the question “How do I write my own Crypto?” the answer is don't. I'm currently studying computer science, and there is no course offered…
loreson
  • 361
  • 3
  • 5
24
votes
5 answers

Why are there few (none?) easy to use encryption libraries?

If I search stack overflow for how to safely encrypt data, one of the first hits is someone's custom encryption scheme. I've seen several similar questions on this site, and in general they are all doomed to be severely flawed at best. Most people…
user50849
  • 2,580
  • 2
  • 17
  • 15
22
votes
3 answers

What is the difference between "key length" and "bit strength"?

On occasion, I hear the terms "key length" and "bit strength" used interchangeably. Are these the same things? Or are they different?
Mike B
  • 3,458
  • 4
  • 32
  • 42
17
votes
4 answers

What happens when encrypting with private key?

I have a theoretical question. There is a public key-system. Person1 wants to privately send a message to person2. From my understanding, person1 is supposed to encrypt their message with public key. What happens if person1 would use their private…
Filipe
  • 171
  • 1
  • 1
  • 3
15
votes
4 answers

What type of cipher is RSA?

Is RSA a stream cipher or a block cipher?
user1184
  • 557
  • 1
  • 5
  • 8
12
votes
5 answers

Guessing random bit with 100% accuracy

I am soon to start my compulsory military service. I applied to the Cyber Warfare Unit of Finnish army. There was a test for applicants. Since the test is done the questions have now been published here:…
JV JV
  • 155
  • 5
12
votes
1 answer

Is there an organization that reviews/approves crypto implementations?

As I understand it, NIST approves crypto algorithms but doesn't cover specific implementations. I think I've read about IEEE approving hardware implementations of, e.g. AES, but I can't think of any organization that performs an analogous function…
TJ Ellis
  • 223
  • 1
  • 5
11
votes
5 answers

Save private messages encrypted in database

I'm not sure if this question fits better in StackOverflowSE or CryptoSE but i think this is the right place. In an online community portal I want to save users' private messages encrypted in a database so the information can't be leaked if someone…
Banane
  • 113
  • 1
  • 5
10
votes
2 answers

What are the practical uses of large asymmetric keys?

The Windows CNG supports keys of varying sizes, e.g. RSA up to 16384 bits: http://msdn.microsoft.com/en-us/library/windows/desktop/bb204778(v=vs.85).aspx. My understanding is that in crypto today we tend to top out at 4096 for most things because of…
Steve
  • 15,263
  • 3
  • 39
  • 66
9
votes
3 answers

DUKPT - how does the receiver verify the transaction counter?

I have one question regarding this document: ANSI X9.24, Retail Financial Services Symmetric Key Management Part 1: Using Symmetric Techniques In the chapter "Method: DUKPT (Derived Unique Key Per Transaction)", page 41, it says, that the receiver…
gerneGross
  • 91
  • 1
  • 2
9
votes
1 answer

What is a cryptographic puzzle?

On the wikipedia page on TCP under Denial of Service the following paragraph is found: By using a spoofed IP address and repeatedly sending purposely assembled SYN packets, attackers can cause the server to consume large amounts of resources…
bjarkef
  • 231
  • 1
  • 9
8
votes
5 answers

Who SHOULD write crypto code?

I've seen a lot of questions and answers acknowledging the dangers of inventing your own crypto algorithms — and even of implementing proven algorithms yourself. And, I don't disagree. I might even argue most of us don't even know how to safely use…
svidgen
  • 723
  • 5
  • 14
6
votes
3 answers

Asymmetric vs symmetric encryption benchmarks

I have found these benchmarks in Crypto++'s site. http://www.cryptopp.com/benchmarks.html But I am, quite honestly, not entirely sure how to interpret them. I am really looking for a set of benchmarks, or a study, that shows how asymmetric…
user31481
6
votes
1 answer

Crypter Anti-Virus Test

I have written a very simple/basic crypter in C++ and I would like to test it. How would I go about writing a simple MessageBox program that is "tainted" so that my Anti-virus will attempt to quarantine it upon running the file? Right now, I just…
Quaxton Hale
  • 267
  • 2
  • 3
  • 8
1
2 3 4 5 6 7 8