Digital signatures
The conceptHow your phone knows an app update wasn't tampered with
A digital signature is a seal that only the sender can make but anyone can check. It proves who sent something and that not a single letter changed on the way.
When an app maker ships an update, it signs it with a secret key it never shares. Your phone checks the seal with a matching public key that everyone is allowed to have.