83

You have at least two options, depending on what problem you want to solve. If you want innocent readers of your code to not get the answers inadvertently, or you at least want to make it a bit difficult so that users are not tempted, you can encrypt the solutions and store the key as part of your code, perhaps a result of some computation (to make it even ...


60

You are conflating a number of issues here. Why does my software have all these features to begin with? Because other computers' software has those features, and network effects punish any software developer who doesn't follow the herd. Let's take an example from your question: Why does my web browser need to do anything other than basic HTML and CSS? ...


32

The title and the body of your question ask two different questions: how the OS creates entropy (this should really be obtains entropy), and how it generates pseudo-randomness from this entropy. I'll start by explaining the difference. Where does randomness come from? Random number generators (RNG) come in two types: Pseudo-random number generators (PRNG),...


29

You have two three options: Keep the answers separate from the rest of the source code If you want your code to be open source, however don't want the answers to be open source, then you open source the code for the application without the questions & answers, with the questions & answers being a separate closed source "plugin" or data file. Your ...


13

Since the other answers go pretty well into why companies just buy general purpose computers, I wanted to give an answer about security. In a lot of ways, it's easier to secure a system you know is insecure, than to secure a system you are pretty sure is secure but don't know in what ways it might be insecure. Windows 10 may have security vulnerabilities, ...


10

Oblivious RAM is an interface between a program and the physical RAM that when you perform a read or write, does both at the same time on the physical RAM to hide if you are reading or writing. Plus, it shuffles the memory from time to time so that an adversary seeing only accesses to the physical RAM cannot know whetever you accessed the same data twice or ...


10

Can the man in the middle not just take the keys swapped by the opponents, change the keys and then decrypt and encrypt the message again? Yes, they can. A key exchange protocol like (the "textbook" version of) DH is secure against eavesdropping (i.e., simply observing what is being transmitted on the channel), but completely breaks down against man-in-the-...


9

In the crypto community, this task is known as delegated computation, or verifiable delegation. You wish to let the server (the "cloud") to do the work for you, but you also want the cloud to give you some proof that it actually performed the computation (and didn't just output a random output, and ran away with your money). A pointer, off the top of my ...


7

I suppose it would be possible in theory, but computer malware (viruses, worms, etc.) typically don't work this way today, and there are good reasons why they're written the way they are. You might be interested in polymorphic code, which changes itself to evade detection. It changes the sequence of instructions to some other sequence of instructions that ...


7

Since you asked on a computer science site, I'll give you a computer science answer. This might not be the most directly helpful from a programmer's point of view, though understanding this will definitely make you a better programmer. The first argument to the printf function is a char *, i.e. a pointer to a byte¹. However, not all pointers to bytes are ...


7

I believe this is done to illustrate two things. (i) The small probability, that $P$eggy ($P$rover) might be lying. If she really does not know the magic word and $V$ictor ($V$erifier) sees her taking Path $A$, he would always ask her to come back via path $B$, thus the probability of $P$ succeeding when cheating is $0$. However, $ZKP$s usually involve a ...


7

If you want a practical answer: with Intel SGX, the answer seems to be a qualified yes, but software development is likely to be more painful. (Similar with a TPM, though that will be even more annoying.) See, e.g., https://security.stackexchange.com/q/2459/971. If you want a theoretical answer: in theory, you could use various cryptographic schemes for ...


6

To answer your question in the most concise way - yes, this bug could have potentially been caught by formal verification tools. Indeed, the property "never send a block which is bigger than the size of the hearbeat that was sent" is fairly simple to formalize in most specification languages (e.g. LTL). The problem (which is a common criticism against ...


5

TL;DR: computers are not autonomous entities like organisms, with any survival instinct. They just run instructions, and sometimes they run instructions we don't like, so we run other instructions to find the bad ones. I started to say this in the comments, but I think there's a lot more to be said. The virus metaphor is outdated and too widely used by ...


5

The malicious user has to first get the malicious code into kernel space somehow. User and kernel address spaces often look contiguous under linux and various unixes, but user space isn't mapped into kernel space, and vice versa. Some variations of Unix (the Masscomp system, as I recall) made this more explicit by having user space and kernel space start at ...


5

Do you mean "that cannot be affected" or "that was never affected"? Then, under what conditions? Do you mean malware in general or a more restrictive notion of virus? And then, what is virus or malware? Is code for automatic update of your OS considered malware or not? Maybe you do not want to update your OS. Maybe someone has taken control of the updating ...


5

Commercial program checkers like Klocwork or Coverity might have been able to find Heartbleed since it is a relatively simple "forgot to do a bounds check error," which is one of the main problems they are designed to check for. But there is a much simpler way: use opaque abstract data types that are well tested to be free from buffer overrun. There are a ...


5

What you're looking for is Rice's Theorem, which is a generalized version of Halting Undecidability. It basically says that any property of a Turing Machine (i.e. any computer program) is undecidable, if it's a property of the behavior of the program (i.e. a property of the language it accepts/produces), as opposed to a particular syntactic feature of the ...


5

In a man-in-the-middle attack, you ask Bob for his key but Eve intercepts the message and sends you her key instead. She asks Bob for his key and then passes messages between you and Bob, decrypting them, reading and/or changing them in the process. The problem is that you don't know whether or not you really have Bob's key. Certificates get around this ...


5

"If I were running a company ... the employee would see only the "sections" that are relevant for them, coded by me." You are not prescient. You cannot predict the future requirements of all your employees with sufficient accuracy to know the minimum set of "section" that are relevant or suitable for any given employee. The work required to refine this ...


5

I'd use a simple username/password system, with no password resets or two-factor auth Password resets are required somewhere because people forget passwords. 2FA is required sometimes because they leak, as it turns out that building software free of security bugs is incredibly difficult. and once logged in, the employee would see only the sections that ...


4

If you count as a " program verification technique " the combination of runtime bound-checking and fuzzing, yes this particular bug could have been caught. Proper fuzzing will cause the now infamous memcpy(bp, pl, payload); to read across the limit of the memory block pl belongs to. Runtime bound-checking can in principle catch any such access, ...


4

Using a tighter language doesn't just move goal posts around from getting implementation correct to getting the spec right. It is hard to make something that is very wrong yet consistent logically; which is why compilers catch so many bugs. Pointer Arithmetic as it is normally formulated is unsound because the type system doesn't actually mean what it is ...


4

If the object is to obscure strings from casual reading of the source code but keep them open so other people can easily make their own changes - for example if you were publishing the source to a text adventure and didn't want any descriptive text to appear which would constitute a spoiler, then use something reversible like rot13. In fact, you could rot13 ...


4

Open source requires the source code to be made public and available, not the game data. So you could easily put the data in another file and not publish that one. Add some crypto if you want to prevent casual reading of the file. I doubt a strong crypto is necessary for your application.


4

Why would you store your answers in your GPL source code if you don't want your users to know them? Even if they're not known or easily crackable now, they can (and likely will) be in the future. Instead of storing them in your app, use an external database. Make a small web service that compares the answers to what's in your database. Then let your ...


4

I would argue that the premise of the question makes a wrong assumption: There is an enormous amount of people that use computers set up to perform a single task. Behind the scenes, they're generic systems running a full OS and having all capability, but the machine has been specialized for some tasks. For example: Cashiers use machines which are commonly ...


3

the general question is about evolution in malware. the specific question is about genes. there is indeed a genetic algorithm mechanism that uses digital "genes" for optimization & could certainly conceivably be used in viruses/malware, although there do not seem to be any reports of this so far "in the wild". on the other hand, malware has indeed been ...


3

As stated, to prove that the KISS principle is frequently applied, you would need to make a study of design documents of a large number of security-related projects, and measure how often rationales mention KISS as a choice of strategy. I suspect that this isn't what you're being asked, though — but rather, to look for evidence that KISS is a good idea for ...


3

I believe the architecture you're interested in - the AVR - is actually a modified Harvard architecture, whereby instruction memory can be accessed by instructions as if it were data. (I haven't used the AVR in a while, so I don't recall if you can execute instructions out of RAM.) The ARM Cortex M processors (perhaps others) are similar. There aren't too ...


Only top voted, non community-wiki answers of a minimum length are eligible