Run-Time Attack Detection in Cryptographic APIs