Questions tagged [system.security]
59 questions
1
vote
2 answers
How can I edit a DACL in C#?
Is there an analog of the SetFileSecurity function?
I need to re-write some tests from Python and I'm stuck on this part. In Python I can freely edit a DACL with pywin32 (modules with a C++ implementation to work with Windows API).
I can edit any…

Egor Egorov
- 313
- 1
- 4
- 19
1
vote
0 answers
Why RecipientInfos throwing CryptographicException
I've got some class for encrypting and signing emails.
Signing process is going without problems , but when I trying to
encrypt the message using "Encrypt" method on EnvelopedCms instance ,I've got exception with information "invalid cryptographic…

Eryk Hubert Siejka
- 43
- 5
1
vote
2 answers
ProtectedData.Unprotect after User changes password
I have a C# application that stores password information in a database using ProtectedData class. I use a scope of local machine and as I understand It DPAPI will use master key to encrypt it and it won't be changed unless I uninstall OS.
Let's say…

user1480742
- 145
- 12
1
vote
1 answer
After computer restart, 'System.Security.Cryptography.CryptographicException' : Keyset does not exist
I am using following code to sign the data:
RSACryptoServiceProvider csp;
X509Store my = new X509Store(StoreName.My, StoreLocation.LocalMachine);
my.Open(OpenFlags.ReadOnly);
foreach (X509Certificate2 cert in…

Aasish
- 377
- 5
- 18
1
vote
1 answer
Nuget package is not finding and/or using System.Security.Cryptography
I'm writing some nuget packages for personal development, and I'm having a few issues with dependencies. I'm writing a security package and I need System.Security.Cryptography, and I can add a using statement fine (when the navigation bar is on…

TechnicalTophat
- 1,655
- 1
- 15
- 37
1
vote
1 answer
'Cast object of type' error - resolved by IIS recycle
3rd party ASP.Net web site and web service installed. The code appears not to log errors to server log or custom error log.
User receives the following critical untrapped error message:
"System.Web.Services.Protocols.SoapException: Unable to cast…

Klaptrap
- 311
- 3
- 19
1
vote
1 answer
NHibernate + Remoting = ReflectionPermission Exception
We are dealing with a problem when using NHibernate with Remoting in a machine with full trust enviroment (actually that's our dev machine).
The problem happens when whe try to send as a parameter an object previously retrieved from the server, that…

Pedro
- 11,514
- 5
- 27
- 40
1
vote
1 answer
C# Rijndael issue run-time error while trying to decrypt Padding is invalid or cannot be removed
I get a run-time error Padding is invalid and cannot be removed while trying to decrypt some data. I have read all the similar threads I found on stackoverflow and considered the following issues:
Given a different key for decryption than the one…

Dex
- 33
- 9
1
vote
1 answer
Configure Win 7 Network Adapter Programatically in C#
I want to configure all active network adapters in windows 7 programatically through c#.
I have tried following code:
string newIPAddress = "100.200.100.11";
string newSubnetMask = "255.255.255.1";
string[] newGateway = {…

Demon Hunter
- 233
- 1
- 3
- 15
1
vote
0 answers
How can I get a list of all permissions for a certain file system object for a certain user or group using?
I do this at C# winh .NET4.
It is easy to get the current user's credentials for any file or folder (like this).
But the problem is that to get a collection of permissions (Read, Read Attributes, Write, etc.) for any given user or group, and I can…

Billy-Bob
- 11
- 2
0
votes
3 answers
System.Security.SecurityException being thrown on initializing StructureMap bootstrapper
I am running a .NET 4.0 web application locally using the Visual Studio Development Server (built in web server with VS2010), and for the last couple months, my StructureMap bootstrapper file has worked perfectly.
I'm using StructureMap 2.6.1
I have…

Michael McCarthy
- 1,502
- 3
- 18
- 45
0
votes
1 answer
AES-256 for .Net 4.7.2 seems incorrect, is it my usage or MS?
A customer has provided sample code in C# as an encryption spec. My code is in Python 2.7, and I have to make my data match theirs. My data matches an online calculator but not the customer data. To make a demo, I have reduced everything to zero…

Larry Martin
- 89
- 1
- 10
0
votes
1 answer
SignedXml.LoadXML((XmlElement)nodeList[0]) throwing "Malformed element SignedInfo/Reference"
I am having trouble when reading SignedInfo from XML of a signed document, when calling
SignedXml signedXml;
Directory.SetCurrentDirectory(TmpDir);
XmlDocument xmlDoc = new XmlDocument();
foreach(Relationship signature in signs)
{
…

sadis
- 53
- 1
- 6
0
votes
1 answer
System.Security.Cryptography.X509Certificates.X509Certificate2.GetECDsaPublicKey NotImplemented
We have created a signature in a .Net Core web api, using X509Certificate2.GetECDsaPrivateKey on a .pfx certificate file, and need to verify this signature in our Xamarin Android app, using the public key (.crt). I can run the code on a normal…

Thys
- 149
- 1
- 5
0
votes
1 answer
Openssl Command Line for Triple DES HMAC like C# MACTripleDES
Can anyone explain how to make a TDES MAC in OpenSSL command line?
I am trying to duplicate some functionality of a working C# program in C for the OpenSSL API, and am having trouble duplicating the .Net MACTripleDES.ComputeHash function in…

Larry Martin
- 89
- 1
- 10