twrp – How to decrypt /sdcard from ADB?

Long story short, I screwed up, and now I have an encrypted storage (with my files that I want back) but TWRP and the OS thinks it is not.

It goes like this:

  • The Magisk v22.0 update screwed up my phone, which stuck in a
    bootloop.
  • After countless tries with Magisk (updating, uninstalling.
    installing, removing mods, adding mods) in TWRP, I read somewhere to
    dirty flash the ROM.
  • Due to an HDD failure in my PC, I did not have any storage to back up
    my internal storage from the phone.
  • Because I wanted to update the ROM anyways (from MIUI 11 to 12) I
    decided to flash the newer one. That was the first mistake. This
    made the bootloop worse, and now it stuck in fastboot mode, no
    recovery. After many sleepless nights I found out that not every
    USB-C cable is equal, and I couldn’t reach my phone via fastboot
    because of the cable itself.
  • Due to an HDD failure in my PC, I did not have any storage to back up
    my internal storage from the phone.
  • So now I was able to flash an original fastboot ROM which still gave
    me bootloop, but after wiping (not formatting, so the /sdcard fs
    doesn’t gets erased) Data and Cache in TWRP.
  • Then reflashed the fastboot ROM, and somehow it worked. When It
    booted up, I had to type in my screenlock pin again, and after setup
    all my files were available.
  • Now that the phone worked again, I wanted to finish what I started,
    to update to latest EU (recovery) ROM. This was the second mistake.
    It did not work (because it required formatting data, which I did not
    wanted to, and just wiped it), and came bootloop again.
  • So I went back to the fastboot ROM again, which fixed the phone
    again.
  • But this time, it thinks the internal storage is not encrypted.

Now I can’t access the internal storage. Even the camera app says that first I need an SD Card to take photos.

Its clearly still encrypted because when I browse it in TWRP, the structure and files are there, but the names are like “74t7Z1,dnvgIIexr1QAfhD”.

The problem being neither the OS, nor TWRP knows the storage is encrypted, so it doesn’t even tries to decrypt it, and there are no options to do it.

Tried to set encryption in the running OS, but it gave me the same results: even tho TWRP asks for decryption key, and says it successfully decrypted, the storage is still a mess like its in encrypted state.

Is there any way to manually force some flag, so I can access my files again?
I have the encryption key, I just need some way to decrypt the storage. I think of something like an ADB command to flag the partition as encrypted, so TWRP and OS would try to decrypt it.

Thanks in advance!

cryptography – Decrypt AAAAAAAAAAAA with vigenere

Maybe someone can help me.

I have to decrypt the Vigenere Chiffre : AAAAAAAAAAAA

This is all what is given. So I have no keylength or something. I think I’m not supposed to do a brute force attack.

I actually do know how the decryption with Vigenere works. I have already written a program for a different text to translate. But my program works for texts consisting of a natural language. I did a frequency analysis of letters, bigrams.. But I don’t know I can solve this problem here when there is only one letter 12 times.

Maybe this has something to do with redundancy and unicity length?

It may have to do something with redundancy and unicity length because this was part of my lecture the last time, but i don’t know what to do with this information.

Thank you for your help

sd card – I recovered some encrypted pictures, but I can’t decrypt them

My girlfriend lost all the pictures from our holidays. She has a Samsung Galaxy A70. She had an external encrypted SD card on it. I managed to recover the lost pictures, but they are encrypted. Do you have any idea what I can do?

I’ve tried putting back the pictures, and then decrypting the SD but it doesn’t work.

encryption – How to send a fixed size encrypted message to be broadcast to multiple (known) recipients without letting the broadcaster decrypt the message

I am creating a network with three layers. A sender layer, A gateway layer, and a Receiver layer; each having different platforms. See diagram below

enter image description here

All platforms have published their public keys on a trusted public database server (not shown on the diagram).

A sender S wants to send a message to the receiver layer but it can only send the message via one of the platforms in the Gateway layer. Let’s call it G.

The message contains a public section that can be accessed by anyone and a private section that should be accessible only by the receiver layer. Something like below

{
    "public"  : { <public data>  },
    "private" : { <private data - encrypted> }
}

Every time S sends a message to G; G uses the public section of the message to verify the authenticity of the sender and to identify a subset of Receivers { R1, R2 … Rp } where p <= n; and broadcasts the message to the “p” receivers.

How does S encrypt the message such that only {R1, R2 … Rp} are able to decrypt the message and not G?

Some additional forces that exist are as follows:

  • Sender platforms layer can have 1-100000000 independent devices each having its own key pair
  • The gateway platforms could range from a 1-500 platforms
  • The receiver layer could have 1-10000000 platforms each having its own key pair

Any ideas on how to achieve this? I can do this using two Gateways, G1 and G2 where one G1 broadcasts the public key of S and G2 broadcasts the message. The receiver can check if the broadcaster of the key is different from the broadcaster of the message and return an “INSECURE_TRANSACTION” error of sorts. But is there a way to make it work using only one Gateway? Any help would be appreciated.

Unable to decrypt wallet.wallet file

I have a wallet.wallet file that I think was created with Android bitcoin wallet or Multibit. It’s base64 encoded.

Putting it in a decoder, it gives me this information, redacted just in case:

{“iv”:”randomalphanumeric==”,”v”:1,”iter”:1000,”ks”:256,”ts”:64,”mode”:”ccm”,”adata”:””,”cipher”:”aes”,”salt”:”randomalphanumeric=”,”ct”:”randomalphanumeric=”}

When I try to upload any part of that, including just the raw base64, into Electrum (the recommended alternative since multibit was deprecated) I get errors that its invalid. The android bitcoin app either can’t read it or I don’t know my password.

Does anyone have any idea what this is or what its for? Is it even cryptocurrency related?

Also, the last string has a ton of characters including forward slash “/” and plus signs “+”. Not sure if that helps.

I did attempt to try and follow with this thread Bitcoin Wallet for Android – Issues decrypting the wallet backup BIN file using OpenSSL , but to no avail.
I get “error reading input file”

wallet – How to decrypt Bitcoin private key that is encrypted with PKBDF2-SHA256 and iterations and salt

I have exported wallet with encrypted keys and that wallet provider is closed. Is there a way to decrypt priv that is encrypted with PKBDF2-SHA256, iterations and salt. I think I remember the password I have used to encrypt the wallet.

The wallet provider is coinprism. The back-up is in the following format (JSON file)

{“keys”:({“addr”:”<BTC_address>”,”priv”:”<97 length encrypted private key>”, “encryptionMode”:”PKBDF2-SHA256″,”iterations”:2000}),”salt”:””}

encryption – How to decrypt .ZC1PR and .XXFD formats after Ransomeware attack?

My company NAS has been attacked by Ransomeware and all the files are now encrypted to above file formats. Does anyone know any method of decrypting at least some files?

I can find some decryption tools for older ransomware attacks. But unfortunately, I couldn’t find any tool for these file formats.

Thank you.

openssl – How do you manually decrypt RSA oaep-mgf1p XML message?

I have a problem similar to the previous post and used the steps from here, and I got this error at the last step.

*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
bad decrypt

What I am missing?

The XML message I am working on is attached below:

<ocf:encryption xmlns:ocf="urn:oasis:names:tc:opendocument:xmlns:container">
  <EncryptedKey Id="key-4b1dae5e-3d45-4c72-b527-c9503b894187" xmlns="http://www.w3.org/2001/04/xmlenc#">
    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" />
    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
      <KeyName>CN=engine.simple.com</KeyName>
    </KeyInfo>
    <CipherData>
      <CipherValue>W2+3...jfXIKNdjv5z==</CipherValue>
    </CipherData>
  </EncryptedKey>
  <EncryptedData ocf:full-path="/Images/cover.png" xmlns="http://www.w3.org/2001/04/xmlenc#">
    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
      <RetrievalMethod URI="#key-4b1dae5e-3d45-4c72-b527-c9503b894187" Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey" />
    </KeyInfo>
    <CipherData>
      <CipherReference URI="/Images/cover.png" />
    </CipherData>
    <EncryptionProperties>
      <EncryptionProperty>
        <Compression Method="0" OriginalLength="42681" xmlns="http://www.idpf.org/2016/encryption#compression" />
      </EncryptionProperty>
    </EncryptionProperties>
  </EncryptedData>

I want to decrypt the message "Boe an emait" but i don’t know either the algorithm or key, any help? [closed]

the encrypted code is "Boe an emait" and the method is unknown

How to decrypt a file to memory and run it from memory using c, c++, or python?

I have experience with the basics of encryption and decryption and handling files stored on the filesystem using c, c++, and python. But one curiosity I’ve recently encountered is how someone might run an encoded executable, mp3, or any other file safely in memory after being decrypted.

A use case might be someone trying to make code or a file only usable through their service or software, which is my case, I don’t want a user to simply steal my code so when stored on their filesystem my goal is for it to be encrypted. But the big problem with that is that I’m not sure how to decrypt it and run it without it touching the disk.

I am familiar with c, c++, and python and my project is made mostly using those languages. I have done some research and haven’t really found a clear or well explained solution to the problem, the only solution I found was outdated and turned out the decrypted file was actually written to the disk at one point in the process of the “solution”. (I should also note that the OS I am programming for is windows)

So if anyone has any solution to this problem I would very much appreciate it as my research has failed me.