jztan
2007-08-22 09:25:57 UTC
i m implement COPP(Certified Output Protection Protocol -
http://msdn2.microsoft.com/en-us/library/Aa468617.aspx) with Dshow.
in section "importing the driver's public key",
i have a question about size of modulus.
Document in msdn mention that size of modulus is 256 bytes.
as following,
//-------------------------------------------------------------------------------------------------
The base64-encoded array is in big-endian order, whereas the CryptoAPI
expects the number in little-endian order, so you need to swap the
byte order of the array that is returned from CryptStringToBinary. The
modulus is 256 bytes, but the decoded byte array might be less than
256 bytes. If so, you will need to allocate a new array that is 256
bytes, copy the data into the new array, and pad the front of the
array with zeros. The exponent is a DWORD (4-byte) value.
//-------------------------------------------------------------------------------------------------
But why my modulus size is 344 bytes???
the value of my modulus is
//-------------------------------------------------------------------------------------------------
yxCkp/fatiVYTYmsvLlEcf8CzNtEdqKlB1EqUtJnhAXs6bq+wYIRVRWVn8qRUuHZGDUKM
+AY7R61kiy3ASBWVY6kV2UAuLvZ7u5ZxFNQCAq6MCaieaDlKcAzE58RAL3NJt5Q0zxAiImX/
o1In4Or7JjDGhiBEkfwn7/HUtQ40OWlxfCfc/
Zc4dnIQUgR7vBenULZHBP1Y97QGKLJQphKdlMzOmQiEIpan8JT8DVpnMgQRPL/
Tg0GzJ5Ym4cJ/3LMY1VnlstKaYDBaK8ecRGpjvcPaHthWbv1QU6YOAtIaXj0q+NJNZoz/C/
t0NZrryKP6YZ7XUWZ7cxMe6IYn2Wcbw==
//-------------------------------------------------------------------------------------------------
but after i do the base64 decoding the size is 256 bytes.
is that something wrong with my modulus ???
thank you.
http://msdn2.microsoft.com/en-us/library/Aa468617.aspx) with Dshow.
in section "importing the driver's public key",
i have a question about size of modulus.
Document in msdn mention that size of modulus is 256 bytes.
as following,
//-------------------------------------------------------------------------------------------------
The base64-encoded array is in big-endian order, whereas the CryptoAPI
expects the number in little-endian order, so you need to swap the
byte order of the array that is returned from CryptStringToBinary. The
modulus is 256 bytes, but the decoded byte array might be less than
256 bytes. If so, you will need to allocate a new array that is 256
bytes, copy the data into the new array, and pad the front of the
array with zeros. The exponent is a DWORD (4-byte) value.
//-------------------------------------------------------------------------------------------------
But why my modulus size is 344 bytes???
the value of my modulus is
//-------------------------------------------------------------------------------------------------
yxCkp/fatiVYTYmsvLlEcf8CzNtEdqKlB1EqUtJnhAXs6bq+wYIRVRWVn8qRUuHZGDUKM
+AY7R61kiy3ASBWVY6kV2UAuLvZ7u5ZxFNQCAq6MCaieaDlKcAzE58RAL3NJt5Q0zxAiImX/
o1In4Or7JjDGhiBEkfwn7/HUtQ40OWlxfCfc/
Zc4dnIQUgR7vBenULZHBP1Y97QGKLJQphKdlMzOmQiEIpan8JT8DVpnMgQRPL/
Tg0GzJ5Ym4cJ/3LMY1VnlstKaYDBaK8ecRGpjvcPaHthWbv1QU6YOAtIaXj0q+NJNZoz/C/
t0NZrryKP6YZ7XUWZ7cxMe6IYn2Wcbw==
//-------------------------------------------------------------------------------------------------
but after i do the base64 decoding the size is 256 bytes.
is that something wrong with my modulus ???
thank you.