Skip to content

Commit 573dc38

Browse files
committed
add confusables
1 parent 634f539 commit 573dc38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1654
-61
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ end
1515
group :runtime, :all do
1616
gem 'ctf-party', '~> 2.3' # string conversion
1717
gem 'twitter_cldr', '~> 6.11', '>= 6.11.5' # ICU / CLDR
18+
gem 'unicode-confusable', '~> 1.9' # confusable chars
1819
end
1920

2021
# Needed to install dependencies

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PATH
66
dry-cli (~> 1.0)
77
paint (~> 2.3)
88
twitter_cldr (~> 6.11, >= 6.11.5)
9+
unicode-confusable (~> 1.9)
910

1011
GEM
1112
remote: https://rubygems.org/
@@ -55,6 +56,7 @@ GEM
5556
tzinfo
5657
tzinfo (2.0.6)
5758
concurrent-ruby (~> 1.0)
59+
unicode-confusable (1.9.0)
5860
unicode-display_width (2.4.2)
5961
webrick (1.8.1)
6062
yard (0.9.34)
@@ -76,6 +78,7 @@ DEPENDENCIES
7678
rake (~> 13.0)
7779
rubocop (~> 1.53)
7880
twitter_cldr (~> 6.11, >= 6.11.5)
81+
unicode-confusable (~> 1.9)
7982
unisec!
8083
webrick (~> 1.8, >= 1.8.1)
8184
yard (>= 0.9.27, < 0.10)

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ A CLI tool and library to play with Unicode security.
1818

1919
## Features
2020

21-
- Code point ↔️ Surrogates
21+
- **Confusables / homoglyphs**
22+
- List confusables characters for a given character
23+
- Replace all characters from a string with random confusables
24+
- **Hexdump**
25+
- UTF-8, UTF-16, UTF-32 hexadecimal dumps
26+
- **Properties**
27+
- Get all properties of a given Unicode character
28+
- List code points matching a Unicode property
29+
- List all Unicode properties name
30+
- **Surrogates**
31+
- Code point ↔️ Surrogates conversion
2232

2333
## Installation
2434

docs/pages/usage.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
## CLI
44

5+
### General help
6+
57
List commands:
68

79
```
810
$ unisec --help
911
Commands:
12+
unisec confusables [SUBCOMMAND]
13+
unisec hexdump INPUT # Hexdump in all Unicode encodings
14+
unisec properties [SUBCOMMAND]
1015
unisec surrogates [SUBCOMMAND]
1116
```
1217

@@ -40,8 +45,27 @@ Options:
4045
--help, -h # Print this help
4146
```
4247

43-
Also find CLI examples in [the library documentation](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands), e.g. [surrogates](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Surrogates/From).
48+
### Examples
49+
50+
- **Confusables**
51+
- [List](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Confusables/List)
52+
- [Randomize](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Confusables/Randomize)
53+
- [Hexdump](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Hexdump)
54+
- **Properties**
55+
- [Char](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Properties/Char)
56+
- [Codepoints](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Properties/Codepoints)
57+
- [List](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Properties/List)
58+
- **Surrogates**
59+
- [From](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Surrogates/From)
60+
- [To](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands/Surrogates/To)
61+
62+
[Library documentation for commands](https://acceis.github.io/unisec/yard/Unisec/CLI/Commands).
4463

4564
## Library
4665

47-
See examples in [the library documentation](https://acceis.github.io/unisec/yard/Unisec), e.g. [surrogates](https://acceis.github.io/unisec/yard/Unisec/Surrogates).
66+
See examples in [the library documentation](https://acceis.github.io/unisec/yard/Unisec).
67+
68+
- [Unisec::Confusables](https://acceis.github.io/unisec/yard/Unisec/Confusables)
69+
- [Unisec::Hexdump](https://acceis.github.io/unisec/yard/Unisec/Hexdump)
70+
- [Unisec::Properties](https://acceis.github.io/unisec/yard/Unisec/Properties)
71+
- [Unisec::Surrogates](https://acceis.github.io/unisec/yard/Unisec/Surrogates)

docs/yard/Integer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ <h3 class="signature " id="to_hex-instance_method">
304304
</div>
305305

306306
<div id="footer">
307-
Generated on Thu Jul 20 16:52:23 2023 by
307+
Generated on Fri Jul 21 12:37:32 2023 by
308308
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
309309
0.9.34 (ruby-3.2.0).
310310
</div>

docs/yard/Unisec.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<dl>
8080
<dt>Defined in:</dt>
8181
<dd>lib/unisec/utils.rb<span class="defines">,<br />
82-
lib/unisec/cli/cli.rb,<br /> lib/unisec/hexdump.rb,<br /> lib/unisec/version.rb,<br /> lib/unisec/properties.rb,<br /> lib/unisec/surrogates.rb,<br /> lib/unisec/cli/hexdump.rb,<br /> lib/unisec/cli/properties.rb,<br /> lib/unisec/cli/surrogates.rb</span>
82+
lib/unisec/cli/cli.rb,<br /> lib/unisec/hexdump.rb,<br /> lib/unisec/version.rb,<br /> lib/unisec/properties.rb,<br /> lib/unisec/surrogates.rb,<br /> lib/unisec/cli/hexdump.rb,<br /> lib/unisec/confusables.rb,<br /> lib/unisec/cli/properties.rb,<br /> lib/unisec/cli/surrogates.rb,<br /> lib/unisec/cli/confusables.rb</span>
8383
</dd>
8484
</dl>
8585

@@ -93,7 +93,7 @@ <h2>Defined Under Namespace</h2>
9393

9494

9595

96-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Unisec/Hexdump.html" title="Unisec::Hexdump (class)">Hexdump</a></span>, <span class='object_link'><a href="Unisec/Properties.html" title="Unisec::Properties (class)">Properties</a></span>, <span class='object_link'><a href="Unisec/Surrogates.html" title="Unisec::Surrogates (class)">Surrogates</a></span>
96+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Unisec/Confusables.html" title="Unisec::Confusables (class)">Confusables</a></span>, <span class='object_link'><a href="Unisec/Hexdump.html" title="Unisec::Hexdump (class)">Hexdump</a></span>, <span class='object_link'><a href="Unisec/Properties.html" title="Unisec::Properties (class)">Properties</a></span>, <span class='object_link'><a href="Unisec/Surrogates.html" title="Unisec::Surrogates (class)">Surrogates</a></span>
9797

9898

9999
</p>
@@ -135,7 +135,7 @@ <h2>
135135
</div>
136136

137137
<div id="footer">
138-
Generated on Thu Jul 20 16:52:23 2023 by
138+
Generated on Fri Jul 21 12:37:32 2023 by
139139
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
140140
0.9.34 (ruby-3.2.0).
141141
</div>

docs/yard/Unisec/CLI.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<dl>
8080
<dt>Defined in:</dt>
8181
<dd>lib/unisec/cli/cli.rb<span class="defines">,<br />
82-
lib/unisec/cli/hexdump.rb,<br /> lib/unisec/cli/properties.rb,<br /> lib/unisec/cli/surrogates.rb</span>
82+
lib/unisec/cli/hexdump.rb,<br /> lib/unisec/cli/properties.rb,<br /> lib/unisec/cli/surrogates.rb,<br /> lib/unisec/cli/confusables.rb</span>
8383
</dd>
8484
</dl>
8585

@@ -117,7 +117,7 @@ <h2>Overview</h2><div class="docstring">
117117
</div>
118118

119119
<div id="footer">
120-
Generated on Thu Jul 20 16:52:23 2023 by
120+
Generated on Fri Jul 21 12:37:32 2023 by
121121
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
122122
0.9.34 (ruby-3.2.0).
123123
</div>

docs/yard/Unisec/CLI/Commands.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<dl>
8585
<dt>Defined in:</dt>
8686
<dd>lib/unisec/cli/cli.rb<span class="defines">,<br />
87-
lib/unisec/cli/hexdump.rb,<br /> lib/unisec/cli/properties.rb,<br /> lib/unisec/cli/surrogates.rb</span>
87+
lib/unisec/cli/hexdump.rb,<br /> lib/unisec/cli/properties.rb,<br /> lib/unisec/cli/surrogates.rb,<br /> lib/unisec/cli/confusables.rb</span>
8888
</dd>
8989
</dl>
9090

@@ -104,7 +104,7 @@ <h2>Overview</h2><div class="docstring">
104104
<p class="children">
105105

106106

107-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Commands/Properties.html" title="Unisec::CLI::Commands::Properties (module)">Properties</a></span>, <span class='object_link'><a href="Commands/Surrogates.html" title="Unisec::CLI::Commands::Surrogates (module)">Surrogates</a></span>
107+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Commands/Confusables.html" title="Unisec::CLI::Commands::Confusables (module)">Confusables</a></span>, <span class='object_link'><a href="Commands/Properties.html" title="Unisec::CLI::Commands::Properties (module)">Properties</a></span>, <span class='object_link'><a href="Commands/Surrogates.html" title="Unisec::CLI::Commands::Surrogates (module)">Surrogates</a></span>
108108

109109

110110

@@ -125,7 +125,7 @@ <h2>Overview</h2><div class="docstring">
125125
</div>
126126

127127
<div id="footer">
128-
Generated on Thu Jul 20 16:52:23 2023 by
128+
Generated on Fri Jul 21 12:37:32 2023 by
129129
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130130
0.9.34 (ruby-3.2.0).
131131
</div>
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>
7+
Module: Unisec::CLI::Commands::Confusables
8+
9+
&mdash; Documentation by YARD 0.9.34
10+
11+
</title>
12+
13+
<link rel="stylesheet" href="../../../css/style.css" type="text/css" />
14+
15+
<link rel="stylesheet" href="../../../css/common.css" type="text/css" />
16+
17+
<script type="text/javascript">
18+
pathId = "Unisec::CLI::Commands::Confusables";
19+
relpath = '../../../';
20+
</script>
21+
22+
23+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
24+
25+
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
26+
27+
28+
</head>
29+
<body>
30+
<div class="nav_wrap">
31+
<iframe id="nav" src="../../../class_list.html?1"></iframe>
32+
<div id="resizer"></div>
33+
</div>
34+
35+
<div id="main" tabindex="-1">
36+
<div id="header">
37+
<div id="menu">
38+
39+
<a href="../../../_index.html">Index (C)</a> &raquo;
40+
<span class='title'><span class='object_link'><a href="../../../Unisec.html" title="Unisec (module)">Unisec</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../CLI.html" title="Unisec::CLI (module)">CLI</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Commands.html" title="Unisec::CLI::Commands (module)">Commands</a></span></span>
41+
&raquo;
42+
<span class="title">Confusables</span>
43+
44+
</div>
45+
46+
<div id="search">
47+
48+
<a class="full_list_link" id="class_list_link"
49+
href="../../../class_list.html">
50+
51+
<svg width="24" height="24">
52+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55+
</svg>
56+
</a>
57+
58+
</div>
59+
<div class="clear"></div>
60+
</div>
61+
62+
<div id="content"><h1>Module: Unisec::CLI::Commands::Confusables
63+
64+
65+
66+
</h1>
67+
<div class="box_info">
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+
<dl>
80+
<dt>Defined in:</dt>
81+
<dd>lib/unisec/cli/confusables.rb</dd>
82+
</dl>
83+
84+
</div>
85+
86+
<h2>Overview</h2><div class="docstring">
87+
<div class="discussion">
88+
<p>CLI sub-commands <code>unisec confusables xxx</code> for the class <span class='object_link'><a href="../../Confusables.html" title="Unisec::Confusables (class)">Unisec::Confusables</a></span> from the lib.</p>
89+
90+
91+
</div>
92+
</div>
93+
<div class="tags">
94+
95+
96+
</div><h2>Defined Under Namespace</h2>
97+
<p class="children">
98+
99+
100+
101+
102+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Confusables/List.html" title="Unisec::CLI::Commands::Confusables::List (class)">List</a></span>, <span class='object_link'><a href="Confusables/Randomize.html" title="Unisec::CLI::Commands::Confusables::Randomize (class)">Randomize</a></span>
103+
104+
105+
</p>
106+
107+
108+
109+
110+
111+
112+
113+
114+
115+
</div>
116+
117+
<div id="footer">
118+
Generated on Fri Jul 21 12:37:32 2023 by
119+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
120+
0.9.34 (ruby-3.2.0).
121+
</div>
122+
123+
</div>
124+
</body>
125+
</html>

0 commit comments

Comments
 (0)