Questions tagged [securestring]

Represents text that should be kept confidential. The text is encrypted for privacy when being used, and deleted from computer memory when no longer needed

SecureString object is similar to a String object in that it has a text value. However, the value of a SecureString object is automatically encrypted, can be modified until the application marks it as read-only, and can be deleted from computer memory by either the application or the .NET Framework garbage collector.

224 questions
0
votes
0 answers

How to hash a password stored in a securestring?

My C# console app actually prompts the user for a password and process the password as a string: Console.Write("Please enter your password: "); string password = GetPassword(); var hashedPassword =…
Less White
  • 561
  • 4
  • 13
0
votes
1 answer

Marshal Unmanaged Unicode String in COM Task Allocator Memory to SecureString

I an working with API calls to advapi32.dll for managing Windows Saved Credentials in order to automate certain windows applications which can use saved credentials, which is working fine. I am trying to update my code to use SecureString for…
Ashigore
  • 4,618
  • 1
  • 19
  • 39
0
votes
1 answer

SecureString Passwords for ADUser

I'm currently making ADUser accounts on a server, and one of the standards here is that the accounts must have a password, even if it is a default password that all new accounts share. I'm a bit confused by the -AccountPassword parameter on…
Maxime Franchot
  • 1,015
  • 1
  • 10
  • 24
0
votes
2 answers

Why does SecureString not have an overloaded constructor?

Consider the following: _securePassword = New SecureString() For Each character As Char In password _securePassword.AppendChar(character) Next Surprisingly, the documentation seems to imply this is the "best practice" way to populate a…
Matt
  • 1,674
  • 2
  • 16
  • 34
0
votes
1 answer

Deleting content of String

I would like to remove a String from the memory of .NET application. Lets say we have a Decryption method, which comes from a 3rd party lib and it returns a String. This is not smart, but there is nothing I can do about it. String s =…
Jaster
  • 8,255
  • 3
  • 34
  • 60
0
votes
1 answer

System returning name of class instead of variable

I have a small PowerShell script I'm writing that allows me to grab a user from Active Directory and randomly generate a password for them. $Alphabet=$NULL for ($a=48; $a –le 70; $a++) { $Alphabet += ,[char][byte]$a } function…
Austin Kargl
  • 89
  • 2
  • 10
0
votes
1 answer

Storing passwords (ConvertFrom-SecureString vs. Export-CliXml)

I understand that I can use both methods to save a password to a text file: Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File C:\cred.txt and Get-Credential | Export-Clixml c:\cred.xml I also understand that both methods make the…
StackExchangeGuy
  • 741
  • 16
  • 36
0
votes
1 answer

xamarin.android X509Certificate2 constructor/import failed with SecureString password instead of plain string

I have a self signed certificate with private key in a PFX file. It is added as resource in a Xamarin.Android c# application in Visual Studio 2015. I'm using it as client certificate to establish secure HTTPS connection to a Web service. To do this…
0
votes
0 answers

SecureString could not be created (asp.net)

when I try to build SecureString there is no in code error, but upon building it writes: CS0246: The Type or Namespace Name Could Not be Found. I have assembly for System.Security in dnx 4.5.1 and the library is linked at the top of the page. Can…
user3025493
  • 109
  • 9
0
votes
1 answer

Powershell secure string password using key to work on any machine

I need help with secure strings I understand that this way is not very secure. But this is on the admin side of the machine. However, I do not want the password in plain text for admins to see. I've successfully got this method to work with this…
Grant Campbell
  • 143
  • 2
  • 12
0
votes
1 answer

How do I insert private/public key in SecureString to the RSACryptoServiceProvider

Let assume I've hardcoded my RSA key in string const: private const String rsaXmlKey = "something Then I can use it with RSACryptoServiceProvider in that way: RSACryptoServiceProvider csp = new…
chaqol
  • 71
  • 1
  • 4
0
votes
1 answer

Process.start() WMIC.exe password issue

I am trying to run WMIC as Admin via my program, using the following code works, but only if WMIC.exe is allready run as an administrator, otherwise it will just return an empty HTML. I can't seem to find a related issue on stackoverflow or…
DaBeast
  • 23
  • 9
0
votes
1 answer

SecureString With SecureKey Issues

I have below code which works without any error. SaveKeyPass.ps1 is storing an secure key (encrypted) and password (encrypted using the securekey) GetKeyPass.ps1 gets the secure key and password from files then decrypts secure key and in the last…
scorpio
  • 1,587
  • 2
  • 15
  • 27
0
votes
1 answer

C# app.config SecureString string can't recast as SecureString

I have a SecureString in my application config, but when retriving it i can't recast the string to SecureString. string UserPassword = AppSetting.Get(config, "password"); UserCredential.Password = (SecureString)UserPassword; Cannot convert type…
Lee Stevens
  • 472
  • 5
  • 17
0
votes
3 answers

Store encrypted string in script

I need to store some credentials for an SMTP server in my script, but naturally I don't want to password to be stored in plaintext. So far I've been encrypting the password like this: "password" | ConvertTo-SecureString -AsPlainText -Force | …
PnP
  • 3,133
  • 17
  • 62
  • 95
1 2 3
14
15