Skip to content

Commit 4426ffb

Browse files
authored
Add files via upload
1 parent bac5605 commit 4426ffb

14 files changed

+222
-41
lines changed

IPFSS_IPFS-Secure

38.6 KB
Binary file not shown.

art_link/apexflexflexsecure.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
····································································
2+
:_______ _______________ _________:
3+
:___ |________________ __ ___ ____/__ /________ __ ______/_/:
4+
:__ /| |__ __ \ _ \_ |/_/ __ /_ __ /_ _ \_ |/_/ ____/_/ :
5+
:_ ___ |_ /_/ / __/_> < _ __/ _ / / __/_> < __/_/ :
6+
:/_/ |_| .___/\___//_/|_| /_/ /_/ \___//_/|_| /_/ :
7+
: /_/ :
8+
:_______________ ________ :
9+
:___ ____/__ /________ ___ ___/______________ _____________ :
10+
:__ /_ __ /_ _ \_ |/_/____ \_ _ \ ___/ / / /_ ___/ _ \ :
11+
:_ __/ _ / / __/_> < ____/ // __/ /__ / /_/ /_ / / __/ :
12+
:/_/ /_/ \___//_/|_| /____/ \___/\___/ \__,_/ /_/ \___/ :
13+
····································································

art_link/art_link.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package art_link
2+
3+
import (
4+
"bufio"
5+
"fmt"
6+
"strings"
7+
"time"
8+
"embed"
9+
)
10+
//go:embed *.txt
11+
var artFiles embed.FS
12+
13+
14+
func PrintFileSlowly(fileName string) error {
15+
fileData, err := artFiles.ReadFile(fileName)
16+
if err != nil {
17+
return err
18+
}
19+
20+
scanner := bufio.NewScanner(strings.NewReader(string(fileData)))
21+
for scanner.Scan() {
22+
line := scanner.Text()
23+
for _, char := range line {
24+
fmt.Print(string(char))
25+
time.Sleep(3 * time.Millisecond) // Adjust the delay here to mimic the baud rate
26+
}
27+
fmt.Println()
28+
}
29+
30+
return scanner.Err()
31+
}

art_link/decrypting.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
..,uod8BBBBBBBBBBBBBBBBRPFT?l!i:.
2+
,=m8BBBBBBBBBBBBBBBRPFT?!||||||||||||||
3+
!...:!TVBBBRPFT||||||||||!!^^""' ||||
4+
!.......:!?|||||!!^^""' ||||
5+
!.........|||| ||||
6+
!.........|||| ## ||||
7+
!.........|||| DECRYPTING FILES ||||
8+
!.........|||| ||||
9+
!.........|||| ||||
10+
!.........|||| DECRYPTING FILES ||||
11+
`.........|||| ,||||
12+
.;.......|||| _.-!!|||||
13+
.,uodWBBBBb.....|||| _.-!!|||||||||!:'
14+
!YBBBBBBBBBBBBBBb..!|||:..-!!|||||||!iof68BBBBBb....
15+
!..YBBBBBBBBBBBBBBb!!||||||||!iof68BBBBBBRPFT?!:: `.
16+
!....YBBBBBBBBBBBBBBbaaitf68BBBBBBRPFT?!::::::::: `.
17+
!......YBBBBBBBBBBBBBBBBBBBRPFT?!::::::;:!^"`;::: `.
18+
!........YBBBBBBBBBBRPFT?!::::::::::^''...::::::; iBBbo.
19+
`..........YBRPFT?!::::::::::::::::::::::::;iof68bo. WBBBBbo.
20+
`..........:::::::::::::::::::::::;iof688888888888b. `YBBBP^'
21+
`........::::::::::::::::;iof688888888888888888888b. `
22+
`......:::::::::;iof688888888888888888888888888888b.
23+
`....:::;iof688888888888888888888888888888888899fT!
24+
`..::!8888888888888888888888888888888899fT|!^"'
25+
`' !!988888888888888888888888899fT|!^"'

art_link/encrypting.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
..,uod8BBBBBBBBBBBBBBBBRPFT?l!i:.
2+
,=m8BBBBBBBBBBBBBBBRPFT?!||||||||||||||
3+
!...:!TVBBBRPFT||||||||||!!^^""' ||||
4+
!.......:!?|||||!!^^""' ||||
5+
!.........|||| ||||
6+
!.........|||| ## ||||
7+
!.........|||| ENCRYPTING FILES ||||
8+
!.........|||| ||||
9+
!.........|||| ||||
10+
!.........|||| ENCRYPTING FILES ||||
11+
`.........|||| ,||||
12+
.;.......|||| _.-!!|||||
13+
.,uodWBBBBb.....|||| _.-!!|||||||||!:'
14+
!YBBBBBBBBBBBBBBb..!|||:..-!!|||||||!iof68BBBBBb....
15+
!..YBBBBBBBBBBBBBBb!!||||||||!iof68BBBBBBRPFT?!:: `.
16+
!....YBBBBBBBBBBBBBBbaaitf68BBBBBBRPFT?!::::::::: `.
17+
!......YBBBBBBBBBBBBBBBBBBBRPFT?!::::::;:!^"`;::: `.
18+
!........YBBBBBBBBBBRPFT?!::::::::::^''...::::::; iBBbo.
19+
`..........YBRPFT?!::::::::::::::::::::::::;iof68bo. WBBBBbo.
20+
`..........:::::::::::::::::::::::;iof688888888888b. `YBBBP^'
21+
`........::::::::::::::::;iof688888888888888888888b. `
22+
`......:::::::::;iof688888888888888888888888888888b.
23+
`....:::;iof688888888888888888888888888888888899fT!
24+
`..::!8888888888888888888888888888888899fT|!^"'
25+
`' !!988888888888888888888888899fT|!^"'

art_link/flex_implant.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
...:::
3+
:.. .::.
4+
.:: .. .:.
5+
:: .::: .:
6+
.:. :::: .:
7+
.: .::: :.
8+
.:. :::: ::
9+
:: ::: ::
10+
.:: .:
11+
.. =+++=::.
12+
..-=++****=:
13+
..-+*#####*::
14+
.:+######*=:.
15+
..-**###*#*:.
16+
.:+***###*=:.
17+
..:+***++++::.
18+
..-==++== ::
19+
.. :=: .:.
20+
.. .: ::
21+
.: .:::. ::
22+
.. .::: ::
23+
.. .:::. :.
24+
::. :::: ..
25+
:: ::: .
26+
.:. ..
27+
::: ..
28+
.::::...
29+

art_link/ipfs.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.===:
2+
:==-::::-=:
3+
:=-:::::::::::-=:
4+
==-:::::::::::::::-==. *#= :########: %#######: :#######*
5+
=====-:::::::::-==--=. *#= :## ##: ##. .##: =#*
6+
=----====-=-===--:::=. *#= :## *#- %#. .##+:
7+
==------=====:::::-:=. *#= :##+++*##= %#######. -+#####=
8+
=--------===::-:-:::=. *#= :##:::. ##. =##
9+
==-------==-::::::-:=. *#= :## ##. :##: -##
10+
==-------==-:-:-::-==. *#= :## %#. .#######*.
11+
:==----==-:::-==:
12+
:===-=--==:
13+
.===.

art_link/ipfs_small.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-==.
2+
.-=:::::-=:
3+
:=-:::::::::::-=: :=: -====- :======: -=++=
4+
===-:::::::::-===: :#- +# :## -#: :## :#=
5+
=---===:-:-==-::=: :#- +# +#:-#: :##
6+
=------===-:::-:=: :#- +#+++##= -######: .=####*.
7+
=-------=-:-::::=: :#- +# -#: . ##
8+
=-------=-:::-::=: :#- +# -#: :##. :##
9+
:==-----=-:-::-=: :=: -= :=. :++++
10+
.==--=-:-=:
11+
===.

art_link/scannow.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
____
2+
/ ___| ___ __ _ _ __ _ __ _____ __
3+
\___ \ / __/ _` | '_ \ | '_ \ / _ \ \ /\ / /
4+
___) | (_| (_| | | | | | | | | (_) \ V V /
5+
|____/ \___\__,_|_| |_| |_| |_|\___/ \_/\_/

go.mod

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
11
module IPFSS_IPFS-Secure
22

33
go 1.21.4
4-
5-
require github.com/status-im/keycard-go v0.3.2
6-
7-
require (
8-
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
9-
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
10-
github.com/ethereum/go-ethereum v1.10.26 // indirect
11-
github.com/go-stack/stack v1.8.1 // indirect
12-
golang.org/x/crypto v0.1.0 // indirect
13-
golang.org/x/sys v0.2.0 // indirect
14-
golang.org/x/text v0.4.0 // indirect
15-
)

keycard-linux-amd64

6.27 MB
Binary file not shown.

log_CID.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
QmQSv6fXvzeBG7ZRA3eAUs1LbZzperrTz1E71aXX68UDgf

main.go

Lines changed: 65 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"crypto/sha256"
1111
"strings"
1212
"IPFSS_IPFS-Secure/keycard_link"
13+
"IPFSS_IPFS-Secure/art_link"
1314
"IPFSS_IPFS-Secure/ipfs_link"
1415
)
1516

@@ -32,43 +33,65 @@ func main() {
3233
}
3334
// Example: Parsing command-line arguments
3435
// You might want to use a more robust way for parsing arguments (like the `flag` package)
35-
if len(os.Args) < 2 {
36-
fmt.Println("Usage: main.go [command]")
37-
os.Exit(1)
38-
}
39-
40-
command := os.Args[1]
4136

42-
switch command {
43-
case "encrypt":
44-
if len(os.Args) != 3 {
45-
fmt.Println("Usage: main.go encrypt [filename]")
46-
os.Exit(1)
47-
}
48-
filename := os.Args[2]
49-
err := encryptFile(filename)
37+
for {
38+
choice, err := menu()
5039
if err != nil {
51-
fmt.Printf("Error encrypting file: %s\n", err)
52-
os.Exit(1)
40+
fmt.Println("Error:", err)
41+
continue
5342
}
5443

55-
case "decrypt":
56-
if len(os.Args) != 3 {
57-
fmt.Println("Usage: main.go decrypt [filename]")
58-
os.Exit(1)
59-
}
60-
filename := os.Args[2]
61-
err := decryptFile(filename)
62-
if err != nil {
63-
fmt.Printf("Error decrypting file: %s\n", err)
64-
os.Exit(1)
44+
switch choice {
45+
case "1":
46+
filename, err := generalAskUser("Enter the filename to decrypt ('Save file as'): ")
47+
if err != nil {
48+
fmt.Println("Error:", err)
49+
continue
50+
}
51+
if err := decryptFile(filename); err != nil {
52+
fmt.Println("Error:", err)
53+
}
54+
55+
case "2":
56+
filename, err := generalAskUser("Enter the filename to encrypt: ")
57+
if err != nil {
58+
fmt.Println("Error:", err)
59+
continue
60+
}
61+
if err := encryptFile(filename); err != nil {
62+
fmt.Println("Error:", err)
63+
}
64+
65+
case "3":
66+
err := art_link.PrintFileSlowly("apexflexflexsecure.txt")
67+
if err != nil {
68+
fmt.Println("Error displaying ASCII art:", err)
69+
}
70+
71+
fmt.Println("Exiting...")
72+
os.Exit(0)
73+
74+
default:
75+
fmt.Println("Invalid option, please try again.")
6576
}
77+
}
78+
}
6679

67-
default:
68-
fmt.Println("Invalid command")
69-
os.Exit(1)
80+
func menu() (string, error) {
81+
err := art_link.PrintFileSlowly("ipfs.txt")
82+
if err != nil {
83+
fmt.Println("Error displaying ASCII art:", err)
7084
}
85+
86+
fmt.Println("=============================================")
87+
fmt.Println("What would you like to do? Select 1, 2, or 3")
88+
fmt.Println("1. Decrypt / pull file with CID.")
89+
fmt.Println("2. Encrypt / upload sensitive data to IPFS.")
90+
fmt.Println("3. Exit.")
91+
fmt.Println("=============================================")
92+
return generalAskUser("Enter your choice: ")
7193
}
94+
7295
func downloadKeycardBinary() error {
7396
url := "https://github.com/status-im/keycard-cli/releases/download/0.7.0/keycard-linux-amd64"
7497
response, err := http.Get(url)
@@ -130,6 +153,10 @@ func askUserYN(question string) bool {
130153
}
131154

132155
func encryptFile(filename string) error {
156+
// Get the Keycard public key
157+
art_link.PrintFileSlowly("scannow.txt")
158+
art_link.PrintFileSlowly("flex_implant.txt")
159+
133160
publicKey, err := keycard_link.GetKeycardPublicKey()
134161
if err != nil {
135162
return fmt.Errorf("error getting Keycard public key: %w", err)
@@ -139,13 +166,17 @@ func encryptFile(filename string) error {
139166
if err != nil {
140167
return fmt.Errorf("error reading passphrase: %w", err)
141168
}
169+
fmt.Print("Generating the seed for KDF ... ")
142170

143171
seedKDF := publicKey + passphrase
144172
fmt.Println("SeedKDF:", seedKDF)
173+
fmt.Print("Generating the symmetric key... \n")
145174

146175
// Derive a key using a KDF (e.g., SHA-256)
147176
kdfKey := sha256.Sum256([]byte(seedKDF))
148177
encryptedKey := fmt.Sprintf("%x", kdfKey)
178+
art_link.PrintFileSlowly("encrypting.txt")
179+
149180

150181
// Encrypt the file using GPG and the derived key
151182
cmd := exec.Command("gpg", "--symmetric", "--batch", "--passphrase", encryptedKey, filename)
@@ -217,6 +248,9 @@ func decryptFile(filename string) error {
217248
}
218249

219250
// Get the Keycard public key
251+
art_link.PrintFileSlowly("scannow.txt")
252+
art_link.PrintFileSlowly("flex_implant.txt")
253+
220254
publicKey, err := keycard_link.GetKeycardPublicKey()
221255
if err != nil {
222256
return fmt.Errorf("error getting Keycard public key: %w", err)
@@ -228,9 +262,11 @@ func decryptFile(filename string) error {
228262
return fmt.Errorf("error reading passphrase: %w", err)
229263
}
230264
// Generate the symmetric key
265+
fmt.Print("Generating the symmetric key... \n")
231266
seedKDF := publicKey + passphrase
232267
kdfKey := sha256.Sum256([]byte(seedKDF))
233268
decryptedKey := fmt.Sprintf("%x", kdfKey)
269+
art_link.PrintFileSlowly("decrypting.txt")
234270

235271
// Decrypt the file using GPG
236272
decryptedFilePath := "decrypted_" + filename // This is the path where the decrypted file will be saved

test.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
+++++++++++++++++++++++++++++++
2+
TEST TEST TEST
3+
OF THE IPFS KEYCARD SYSTEM
4+
+++++++++++++++++++++++++++++++

0 commit comments

Comments
 (0)