ondhbcjg
Re:Why does my SSH private key still work after changing some bytes? (...
on Saturday December 31, 2022 @08:36AM (#34196314)
It shouldn't be possible to manipulate the ASN.1. The answer to your first question should be no, to the second yes.
See this brand-new paper which briefly discusses the desired property of "non-malleability": https://www.fstar-lang.org/papers/asn1star.pdf
"DER are designed to ensure that every value of a given ASN.1 type has a distinct, canonical wire format representation. That is, DER formats are intended to be unambiguous and non-malleable, in the sense that given a bit string b that encodes a value v, every parser will yield back o, whereas changing any bit in b either produces an invalid representation or yields a distinct value o' + v. These properties are particularly important in security applications, inasmuch as they depend on values u but apply cryptographic protection only on binary formats b."