go get golang.org/x/crypto/pbkdf2
go run pbkdf.go
#OUTPUT---
KEY=...
IV=...
#---OUTPUT
FILEIN=2018-12-10-094956-65761430-a301-4203-b3b9-3cff284dac86
FILEOUT=094956-65761430-a301-4203-b3b9-3cff284dac86
openssl enc -d -aes-256-ctr -in $FILEIN -nosalt -p -K $KEY -iv $IV -out $FILEOUT.bz2
bunzip2 $FILEOUT.bz2
tar tf $FILEOUT
Created
December 10, 2018 11:31
-
-
Save shreddedbacon/5443991b1c11cd42730bee1e01915bc5 to your computer and use it in GitHub Desktop.
decrypt fixed key backups from shield
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "golang.org/x/crypto/pbkdf2" | |
import "crypto/sha256" | |
import "encoding/hex" | |
import "bytes" | |
func main() { | |
fixedKey := "FIXED_KEY_FROM_SHIELD" | |
generatedMaterial := pbkdf2.Key([]byte(fixedKey[32:]), []byte(fixedKey[:32]), 4096, 48, sha256.New) | |
key := hex.EncodeToString(generatedMaterial[:32]) | |
iv := hex.EncodeToString(generatedMaterial[32:]) | |
fmt.Println("KEY=" + key) | |
fmt.Println("IV=" + iv) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment