This is possible with Aspose.Pdf for .NET, which is a commercial .NET component. It has a boolean property IsEncrypted for encrypted file detection. Sample code is given below.
// load the source PDF doucment
PdfFileInfo fileInfo = new PdfFileInfo(dataDir + "protected.pdf");
// determine that source PDF file is Encrypted with password
bool encrypted = fileInfo.IsEncrypted;
MessageBox.Show("Encrypted: " + encrypted);
I work for Aspose as a Developer Evangelist.