0

I want to insert cookies to chrome (C:\Users<User>\AppData\Local\Google\Chrome\User Data\Default\Cookies), via a python script and sqlite. The actual cookie values is stored in the column "encrypted_value" and it is a blob. How do I encrypt my plain value to the blob in order to work for chrome. I am currently trying to encrypt it with:

win32crypt.CryptProtectData("test message".encode(), u"<password>", None, None, None, 0)

I am not shure If this is the right way and what actual password I have to use. I tried the users password, but the encrypted value is different to the value chrome encrypted. Online I found a lot about windows DPAPI library, but I am not sure how this works in this idea. Does "win32crypt.CryptProtectData" uses DPAPI ?

Please share some thoughts. Jonas

Jonaswinz
  • 342
  • 4
  • 15
  • Yes win32.cryptProtectData is the core of DPAPI. It hooks and calls into a Windows dll that implements the call. – Henno Brandsma May 18 '21 at 06:21
  • the second argument is the "description string" not an actual passowrd BTW, see [here](http://timgolden.me.uk/pywin32-docs/win32crypt__CryptProtectData_meth.html) for the API. – Henno Brandsma May 18 '21 at 06:28

1 Answers1

0

Ok I found the solution here: Chrome 80 how to decode cookies. Since chrome 80 it is not so easy anymore.

Jonaswinz
  • 342
  • 4
  • 15