homographhardened

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package homographhardened provides escape functions to thwart homograph attacks. It may be used to display untrusted information to a human recipient whilst still being recoverable (though one caveat is that e.g. shell piping may require an additional unescaping; yet e.g. newlines inside a "Subject:" lines will Line-escaped yield to a singular line). As such, a list of Line images may be injectively catenated with a newline, a list of Word images may be injectively catenated with a space. homographhardened MUST NOT be used for domain-specific escaping such as XML or query languages, as their semantics differ from HomographHardened attack scenario. (That is, "<" has herein no special meaning as it does not constitute a homograph attack). However, quotes are escaped. Line and Word does not add quote markers. Line and Word are injective on all byte slices (i.e. even on non-UTF8- valid strings). homographhardened is currently optimised for English, German and French.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Line

func Line(raw string) string

Line escapes a string to both be homograph-hardened and make '\n'-catenation injective. Line is injective.

func Word

func Word(raw string) string

Word escapes a string to both be homograph-hardened and make '\n'-catenation as well as ' '-catenation injective. Word is injective.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL