Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argon2 key derivation #241

Merged
merged 6 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions aesgcm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"encoding/hex"
"strings"

"golang.org/x/crypto/scrypt"
"golang.org/x/crypto/argon2"
)

func DeriveKey(password string, salt []byte) ([]byte, []byte, error) {
Expand All @@ -18,10 +18,7 @@ func DeriveKey(password string, salt []byte) ([]byte, []byte, error) {
}
}

key, err := scrypt.Key([]byte(password), salt, 131072, 8, 1, 32)
if err != nil {
return nil, nil, err
}
key := argon2.Key([]byte(password), salt, 3, 32*1024, 1, 32)

return key, salt, nil
}
Expand Down
3 changes: 2 additions & 1 deletion breez.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ func (bs *BreezService) ListTransactions(ctx context.Context, senderPubkey strin
}

transactions = []Nip47Transaction{}
for _, payment := range payments {
paymentList := payments[0:100]
rolznz marked this conversation as resolved.
Show resolved Hide resolved
for _, payment := range paymentList {
if payment.PaymentType != breez_sdk.PaymentTypeReceived && payment.PaymentType != breez_sdk.PaymentTypeSent {
// skip other types of payments for now
continue
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type AppConfig struct {
LNDMacaroonFile string `envconfig:"LND_MACAROON_FILE"`
Workdir string `envconfig:"WORK_DIR" default:".data"`
Port string `envconfig:"PORT" default:"8080"`
DatabaseUri string `envconfig:"DATABASE_URI" default:"nostr-wallet-connect.db"`
DatabaseUri string `envconfig:"DATABASE_URI" default:".data/nwc.db"`
rolznz marked this conversation as resolved.
Show resolved Hide resolved
CookieSecret string `envconfig:"COOKIE_SECRET"`
}

Expand Down
Loading