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

381 Add Wire Authentication #3

Closed
wants to merge 7 commits into from
Closed

Conversation

NhoxxKienn
Copy link

@NhoxxKienn NhoxxKienn commented Feb 16, 2024

Description

This PR serves to fix the hyperledger-labs#381 issue of Wire Authentication.

TLS Connection

Location: wire/net/simple

Issue: currently using TCP without TLS for communication.

Solution: Implement a simple mutual TLS Dialer and TLS Listener in the simple package, the default net wire for go-perun.

Bonus: A simple connection test has also been set up with self-signed Certificates in dialer_internal_test.go

Wire identity authentication

Location: wire/address.go, wire/account.go, and wire/net/exchange_addr.go, wire.proto

Issue: While each message currently contains a sender and recipient wire address in its Envelope, those are not yet authenticated; there is no signature in the wire.proto. This means anyone can send a message coming from SENDER, without needing the private key, thus allowing to spoof any wire identity.

Solution: Add Signing and Verifying for Account and Address. Like Wallet, the Account is expected to hold the private key, and the Address serves as the Public Key. Wire Authentication can be achieved by including a signature signed by the account in the AuthResponseMsg. Recipient can check the validity of this signature using the Sender Address (Public Key) to decrypt the signature.

Wire Authentication Implementation

Location: backend/sim/wire and wire/net/simple

Description: A simple implementation for the integration of key-pair to be used for wire authentication has been implemented in the testing and default wire.

For backend/sim/wire: This simple signing and verification of signature, independent from the given message.

For wire/net/simple: RSA-2048 Random-generated Key-Pair for (Account, Address), Signing of a given message by hashing and encrypting. Signature length: 256 Bits.

An address exchange test has also been added to the package to test the authentication function.

Visualization

Signed-off-by: Minh Huy Tran <[email protected]>
…ple, update interface of wire.Account/Address to allow signing/verification

Signed-off-by: Minh Huy Tran <[email protected]>
@NhoxxKienn NhoxxKienn force-pushed the 381_wire_authentication branch 9 times, most recently from f79e2d3 to b3a1fb1 Compare February 16, 2024 12:47
Signed-off-by: Minh Huy Tran <[email protected]>
@NhoxxKienn NhoxxKienn self-assigned this Feb 16, 2024
@NhoxxKienn NhoxxKienn added the enhancement New feature or request label Feb 16, 2024
@NhoxxKienn NhoxxKienn force-pushed the 381_wire_authentication branch 3 times, most recently from 2c4789e to 60571d7 Compare February 19, 2024 12:07
…ngelog-v0.11.0

Update CHANGELOG to include v0.11.0 release
@cryptphil
Copy link

I think you should rather create a PR that merges into the hyperledger repository since this is only a fork :)

@NhoxxKienn NhoxxKienn closed this Feb 26, 2024
@NhoxxKienn
Copy link
Author

closed to merge with hyperledger/go-perun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants