Abstract: In this work we investigate the problem of simultaneous privacy and integrityprotection in cryptographic circuits. We consider a white-box scenario with apowerful, yet limited attacker. A concise metric for the level of probing andfault security is introduced, which is directly related to the capabilities ofa realistic attacker. In order to investigate the interrelation of probing andfault security we introduce a common mathematical framework based on theformalism of information and coding theory. The framework unifies the knownlinear masking schemes. We proof a central theorem about the properties oflinear codes which leads to optimal secret sharing schemes. These schemesprovide the lower bound for the number of masks needed to counteract anattacker with a given strength. The new formalism reveals an intriguing dualityprinciple between the problems of probing and fault security, and provides aunified view on privacy and integrity protection using error detecting codes.Finally, we introduce a new class of linear tamper-resistant codes. These areeligible to preserve security against an attacker mounting simultaneous probingand fault attacks.