> A test suite you can use to implement a libp2p crypto module. A libp2p crypto module is used to ensure all exchanged data between two peers is encrypted.
Secures an inbound [streaming iterable duplex][iterable-duplex] connection. It returns an encrypted [streaming iterable duplex][iterable-duplex], as well as the [PeerId][peer-id] of the remote peer.
**Parameters**
-`localPeer` is the [PeerId][peer-id] of the receiving peer.
-`duplex` is the [streaming iterable duplex][iterable-duplex] that will be encryption.
-`remotePeer` is the optional [PeerId][peer-id] of the initiating peer, if known. This may only exist during transport upgrades.
**Return Value**
-`<object>`
-`conn<duplex>`: An encrypted [streaming iterable duplex][iterable-duplex].
-`remotePeer<PeerId>`: The [PeerId][peer-id] of the remote peer.
Secures an outbound [streaming iterable duplex][iterable-duplex] connection. It returns an encrypted [streaming iterable duplex][iterable-duplex], as well as the [PeerId][peer-id] of the remote peer.
**Parameters**
-`localPeer` is the [PeerId][peer-id] of the receiving peer.
-`duplex` is the [streaming iterable duplex][iterable-duplex] that will be encrypted.
-`remotePeer` is the [PeerId][peer-id] of the remote peer. If provided, implementations **should** use this to validate the integrity of the remote peer.
**Return Value**
-`<object>`
-`conn<duplex>`: An encrypted [streaming iterable duplex][iterable-duplex].
-`remotePeer<PeerId>`: The [PeerId][peer-id] of the remote peer. This **should** match the `remotePeer` parameter, and implementations should enforce this.