[FFmpeg-devel] Using decryption keys in a decoder

Uoti Urpala uoti.urpala
Tue Apr 7 19:05:30 CEST 2009


On Tue, 2009-04-07 at 18:25 +0200, Reimar D?ffinger wrote:
> On Tue, Apr 07, 2009 at 05:01:11PM +0200, Maxim wrote:
> > simple XOR...
> > The encryption key is derived from the password named "AccessWord"
> > entered by the user as follows:
> > 
> > uint32_t   k1 = (AccessWord >> 1) + 16384;
> > uint32_t   k2 = (k1 / 200) * 200 + 21;
> > uint32_t   k3 = (~AccessWord) >> 16;
> 
> Does the lowest bit of AccessWord have any meaning?
> 
> > for (i = 0; i < size; i++) {
> >    k3 = (k3 * k2 + 1) & 0xFFFF;
> >    dataPtr ^= k3;
> >    dataPtr++;
> > }

So k1 is only used as to calculate k2? Or should it appear in the later
formula?

I assume that should be "*dataPtr ^=".

> > I don't know if it may be any kind of known encryption algorithm but
> > it's how it works...
> 
> Depends on how you define "known", it is "xor by pseudo-random number
> generator", should be brute-forceable easy enough (about 24 bit key
> strength I think), though probably not easy enough to do it in realtime.

For that kind of algorithm you could do much better than brute force. If
there's some known plaintext you can solve the k values directly without
much computation.




More information about the ffmpeg-devel mailing list