Consider an abstract storage device (G) that can hold a single element x from a fixed, publicly known finite group G. Storage is private in the sense that an adversary does not have read access to (G) at all. However, (G) is non-robust in the sense that the adversary can modify its contents by adding some offset G. Due to the privacy of the storage device, the value can only depend on an adversary's a priori knowledge of x. We introduce a new primitive called an algebraic manipulation detection (AMD) code, which encodes a source s into a value x stored on (G) so that any tampering by an adversary will be detected, except with a small error probability . We give a nearly optimal construction of AMD codes, which can flexibly accommodate arbitrary choices for the length of the source s and security level . We use this construction in two applications: