diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index d271756b..51901670 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -226,7 +226,7 @@ func (s *server) clientCommunication(port string, c *comm.Comm) (room string, er } if strings.TrimSpace(string(passwordBytes)) != s.password { err = fmt.Errorf("bad password") - enc, _ := crypt.Decrypt([]byte(err.Error()), strongKeyForEncryption) + enc, _ := crypt.Encrypt([]byte(err.Error()), strongKeyForEncryption) if err := c.Send(enc); err != nil { return "", fmt.Errorf("send error: %w", err) }