Questions tagged [dpapi]

DPAPI is the API in Windows that allows a program to store "secrets", like passwords. It is used by Microsoft in IE and storing WiFi passwords and private keys for EFS, and also by Chrome for Windows and Safari for Windows, to store website credentials.

150 questions
1
vote
1 answer

Java DPAPI JNI error java.lang.UnsatisfiedLinkError:

Exception in thread "main" java.lang.UnsatisfiedLinkError: dpapi.DPAPI.CryptProtectData(Ljava/lang/String;[BZ)[B at dpapi.DPAPI.CryptProtectData(Native Method) at dpapi.DataProtector.protect(DataProtector.java:60) at…
BeyondProgrammer
  • 893
  • 2
  • 15
  • 32
1
vote
1 answer

Protect Config File with User-Level DPAPI (WinForms)

I want to protect connection strings in my app.config file. I'm using this code to do it: Public Shared Sub ProtectConnString() Dim config As System.Configuration.Configuration =…
John
  • 2,653
  • 4
  • 36
  • 57
1
vote
0 answers

DPAPI encrypt in C++ app, decrypt in C# app

I want to encrypt data in C++ based application, store it in file, and then decrypt it in other C# application. Could I use corresponding DPAPI parts? Is it possible to protect data in C++ application using CryptProtectData(), write it into file,…
karven
  • 65
  • 6
1
vote
3 answers

Storing passwords for authentication against another system

This is not the usual question "Is it safe to store plain-text users' passwords?". No, it's not safe, we all know that. I'm writing a little application that should authenticate against an external system to do some stuff, and the only available…
Dario Solera
  • 5,694
  • 3
  • 29
  • 34
1
vote
1 answer

How to protect AesCryptoServiceProvider's rgbKey?

We have table where we keep user/password and some other data. Each record's password field must be encrypted. We decided to use AesCryptoServiceProvider for encryption and manually created rgbKey for one time. Then encrypted all the user passwords…
Nazim
  • 639
  • 2
  • 10
  • 26
1
vote
1 answer

How to allow import/export of DPAPI secured credentials

I'm writing a winforms application that stores usernames and passwords locally within a configuration file so that the person using the application does not have to retype their credentials every time they log in to the various services my…
Thenin
  • 127
  • 1
  • 1
  • 5
0
votes
1 answer

Powershell Base64 Decode to bytes hex

i'm trying to get the hex binary (\x**) of a base64 decode result from the Local State of chrome. When i decode the base64 of my encrypted key using [System.Convert]::FromBase64String($local_state.os_crypt.encrypted_key) I get an byte array, but…
Dapkz
  • 13
  • 4
0
votes
2 answers

I am trying to compare two strings but they are only different when I run repr on them in python3

I have two strings in python stored in variables a and b. a is an argument passed to the script and b is the result from decoding the result of win32crypt. I've finally used repr to compare them and no surprise the argument comes back as the word…
Dihmz
  • 1
  • 3
0
votes
1 answer

Calling CryptProtectData in Python, then Calling CryptUnprotectData in C++ returns error 87 (and visa versa)

Using Python 3.11.0 and C++ in Unreal Engine 5.1 I'm encrypting user input using DPAPI in Python (3.11.0), and decrypting it through C++ (UE 5.1), but I get error 87 (which i think is a invalid parameter?) when running CryptUnprotectData in C++. I…
0
votes
1 answer

DPAPI with Keys Stored in the TPM

DPAPI on Windows provides functions to encrypt and decrypt arbitrary data. Functions provided by DPAPI include CryptProtectMemory, CryptUnprotectMemory, CryptProtectData and CryptUnprotectData. I suspect that functions RtlEncryptMemory and…
MartinS
  • 1
  • 1
0
votes
0 answers

Decrypt cookies from Google Chrome

Hello I hope you can help me, I am trying to decrypt Google Chrome cookies, I know that they are in a Cookies file and that in version 80, I need to get a key of the Local State file. My code is as follows # Finds the Chrome encryption key in the…
David
  • 23
  • 3
0
votes
0 answers

Why does DPAPI uses SHA1 in blob/key decryption?

According to my knowledge, SHA1 is not considered as a secure cryptographic hash function. Despite that, it seems to be still used in DPAPI. This can be seen from pypykatz implementation that emulate what DPAPI…
0
votes
0 answers

Using DPAPI in unreal to encrypt and decrypt user input, but the decryption doesn't match the original input

I'm prompting the user for input (a security token in this case). Then I'm encrypting it using DPAPI, and storing it in a text file for later use. The issue I'm having is that when I decrypt the file, it sometimes (often) has random trailing…
0
votes
1 answer

Using CryptDataProtect to output encrypted password for use in RDP file generates the incorrect hash

I am trying to generate an RDP file in C++ to automatically log on to a remote machine. I am using the CryptProtectData function to generate an encrypted string which can then be written to the password 51:b parameter of the file. However, when I…
0
votes
1 answer

Windows 11 - Windows Data Protection API (DPAPI) not supported

ProtectedData.Protect gives me the error "Windows Data Protection API (DPAPI) is not supported on this platform". Using Visual Studio 2022, .Net 5.0, C# console application, and Windows 11. My old programs are able to encrypt and decrypt passwords…
Meneghini
  • 147
  • 1
  • 1
  • 10