Reproducible salts from input without prior knowledge

const salt = new EnchantrixSaltQuasiEntropy('Snider').salty()
This commit is contained in:
Snider 2022-01-23 14:24:05 +00:00
parent f7984f1105
commit fe331cc735
No known key found for this signature in database
GPG key ID: 45EB87B3648C806F
14 changed files with 534 additions and 2 deletions

BIN
.build/img/img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

321
.editorconfig Normal file
View file

@ -0,0 +1,321 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
# max_line_length = 800
# tab_width = 4
trim_trailing_whitespace = true
# ij_continuation_indent_size = 8
# ij_formatter_off_tag = @formatter:off
# ij_formatter_on_tag = @formatter:on
# ij_formatter_tags_enabled = false
# ij_smart_tabs = true
# ij_visual_guides = none
# ij_wrap_on_typing = false
[*.css]
# ij_css_align_closing_brace_with_properties = false
# ij_css_blank_lines_around_nested_selector = 1
# ij_css_blank_lines_between_blocks = 1
# ij_css_brace_placement = end_of_line
# ij_css_enforce_quotes_on_format = false
# ij_css_hex_color_long_format = false
# ij_css_hex_color_lower_case = false
# ij_css_hex_color_short_format = false
# ij_css_hex_color_upper_case = false
# ij_css_keep_blank_lines_in_code = 2
# ij_css_keep_indents_on_empty_lines = false
# ij_css_keep_single_line_blocks = false
# ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
# ij_css_space_after_colon = true
# ij_css_space_before_opening_brace = true
# ij_css_use_double_quotes = true
# ij_css_value_alignment = do_not_align
[*.sass]
# indent_size = 2
# ij_sass_align_closing_brace_with_properties = false
# ij_sass_blank_lines_around_nested_selector = 1
# ij_sass_blank_lines_between_blocks = 1
# ij_sass_brace_placement = 0
# ij_sass_enforce_quotes_on_format = false
# ij_sass_hex_color_long_format = false
# ij_sass_hex_color_lower_case = false
# ij_sass_hex_color_short_format = false
# ij_sass_hex_color_upper_case = false
# ij_sass_keep_blank_lines_in_code = 2
# ij_sass_keep_indents_on_empty_lines = false
# ij_sass_keep_single_line_blocks = false
# ij_sass_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
# ij_sass_space_after_colon = true
# ij_sass_space_before_opening_brace = true
# ij_sass_use_double_quotes = true
# ij_sass_value_alignment = 0
[*.scss]
# indent_size = 2
# ij_scss_align_closing_brace_with_properties = false
# ij_scss_blank_lines_around_nested_selector = 1
# ij_scss_blank_lines_between_blocks = 1
# ij_scss_brace_placement = 0
# ij_scss_enforce_quotes_on_format = false
# ij_scss_hex_color_long_format = false
# ij_scss_hex_color_lower_case = false
# ij_scss_hex_color_short_format = false
# ij_scss_hex_color_upper_case = false
# ij_scss_keep_blank_lines_in_code = 2
# ij_scss_keep_indents_on_empty_lines = false
# ij_scss_keep_single_line_blocks = false
# ij_scss_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
# ij_scss_space_after_colon = true
# ij_scss_space_before_opening_brace = true
# ij_scss_use_double_quotes = true
# ij_scss_value_alignment = 0
[.editorconfig]
# ij_editorconfig_align_group_field_declarations = false
# ij_editorconfig_space_after_colon = false
# ij_editorconfig_space_after_comma = true
# ij_editorconfig_space_before_colon = false
# ij_editorconfig_space_before_comma = false
# ij_editorconfig_spaces_around_assignment_operators = true
[{*.ats,*.ts}]
# indent_style = tab
# max_line_length = 800
# ij_continuation_indent_size = 4
# ij_typescript_align_imports = false
# ij_typescript_align_multiline_array_initializer_expression = false
# ij_typescript_align_multiline_binary_operation = false
# ij_typescript_align_multiline_chained_methods = false
# ij_typescript_align_multiline_extends_list = false
# ij_typescript_align_multiline_for = false
# ij_typescript_align_multiline_parameters = true
# ij_typescript_align_multiline_parameters_in_calls = false
# ij_typescript_align_multiline_ternary_operation = false
# ij_typescript_align_object_properties = 0
# ij_typescript_align_union_types = false
# ij_typescript_align_var_statements = 0
# ij_typescript_array_initializer_new_line_after_left_brace = false
# ij_typescript_array_initializer_right_brace_on_new_line = false
# ij_typescript_array_initializer_wrap = off
# ij_typescript_assignment_wrap = off
# ij_typescript_binary_operation_sign_on_next_line = false
# ij_typescript_binary_operation_wrap = off
# ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
# ij_typescript_blank_lines_after_imports = 1
# ij_typescript_blank_lines_around_class = 1
# ij_typescript_blank_lines_around_field = 0
# ij_typescript_blank_lines_around_field_in_interface = 0
# ij_typescript_blank_lines_around_function = 1
# ij_typescript_blank_lines_around_method = 1
# ij_typescript_blank_lines_around_method_in_interface = 1
# ij_typescript_block_brace_style = end_of_line
# ij_typescript_call_parameters_new_line_after_left_paren = false
# ij_typescript_call_parameters_right_paren_on_new_line = false
# ij_typescript_call_parameters_wrap = off
# ij_typescript_catch_on_new_line = false
# ij_typescript_chained_call_dot_on_new_line = true
# ij_typescript_class_brace_style = end_of_line
# ij_typescript_comma_on_new_line = false
# ij_typescript_do_while_brace_force = never
# ij_typescript_else_on_new_line = false
# ij_typescript_enforce_trailing_comma = remove
# ij_typescript_extends_keyword_wrap = off
# ij_typescript_extends_list_wrap = off
# ij_typescript_field_prefix = _
# ij_typescript_file_name_style = relaxed
# ij_typescript_finally_on_new_line = false
# ij_typescript_for_brace_force = never
# ij_typescript_for_statement_new_line_after_left_paren = false
# ij_typescript_for_statement_right_paren_on_new_line = false
# ij_typescript_for_statement_wrap = off
# ij_typescript_force_quote_style = true
# ij_typescript_force_semicolon_style = true
# ij_typescript_function_expression_brace_style = end_of_line
# ij_typescript_if_brace_force = never
# ij_typescript_import_merge_members = global
# ij_typescript_import_prefer_absolute_path = true
# ij_typescript_import_sort_members = true
# ij_typescript_import_sort_module_name = false
# ij_typescript_import_use_node_resolution = true
# ij_typescript_imports_wrap = on_every_item
# ij_typescript_indent_case_from_switch = true
# ij_typescript_indent_chained_calls = true
# ij_typescript_indent_package_children = 0
# ij_typescript_jsdoc_include_types = true
# ij_typescript_jsx_attribute_value = braces
# ij_typescript_keep_blank_lines_in_code = 2
# ij_typescript_keep_first_column_comment = true
# ij_typescript_keep_indents_on_empty_lines = false
# ij_typescript_keep_line_breaks = true
# ij_typescript_keep_simple_blocks_in_one_line = false
# ij_typescript_keep_simple_methods_in_one_line = false
# ij_typescript_line_comment_add_space = false
# ij_typescript_line_comment_at_first_column = true
# ij_typescript_method_brace_style = end_of_line
# ij_typescript_method_call_chain_wrap = off
# ij_typescript_method_parameters_new_line_after_left_paren = false
# ij_typescript_method_parameters_right_paren_on_new_line = false
# ij_typescript_method_parameters_wrap = off
# ij_typescript_object_literal_wrap = on_every_item
# ij_typescript_parentheses_expression_new_line_after_left_paren = false
# ij_typescript_parentheses_expression_right_paren_on_new_line = false
# ij_typescript_place_assignment_sign_on_next_line = false
# ij_typescript_prefer_as_type_cast = false
# ij_typescript_prefer_explicit_types_function_expression_returns = false
# ij_typescript_prefer_explicit_types_function_returns = false
# ij_typescript_prefer_explicit_types_vars_fields = false
# ij_typescript_prefer_parameters_wrap = false
# ij_typescript_reformat_c_style_comments = true
# ij_typescript_space_after_colon = true
# ij_typescript_space_after_comma = true
# ij_typescript_space_after_dots_in_rest_parameter = false
# ij_typescript_space_after_generator_mult = true
# ij_typescript_space_after_property_colon = true
# ij_typescript_space_after_quest = true
# ij_typescript_space_after_type_colon = true
# ij_typescript_space_after_unary_not = false
# ij_typescript_space_before_async_arrow_lparen = true
# ij_typescript_space_before_catch_keyword = true
# ij_typescript_space_before_catch_left_brace = true
# ij_typescript_space_before_catch_parentheses = true
# ij_typescript_space_before_class_lbrace = true
# ij_typescript_space_before_class_left_brace = true
# ij_typescript_space_before_colon = true
# ij_typescript_space_before_comma = false
# ij_typescript_space_before_do_left_brace = true
# ij_typescript_space_before_else_keyword = true
# ij_typescript_space_before_else_left_brace = true
# ij_typescript_space_before_finally_keyword = true
# ij_typescript_space_before_finally_left_brace = true
# ij_typescript_space_before_for_left_brace = true
# ij_typescript_space_before_for_parentheses = true
# ij_typescript_space_before_for_semicolon = false
# ij_typescript_space_before_function_left_parenth = true
# ij_typescript_space_before_generator_mult = false
# ij_typescript_space_before_if_left_brace = true
# ij_typescript_space_before_if_parentheses = true
# ij_typescript_space_before_method_call_parentheses = false
# ij_typescript_space_before_method_left_brace = true
# ij_typescript_space_before_method_parentheses = false
# ij_typescript_space_before_property_colon = false
# ij_typescript_space_before_quest = true
# ij_typescript_space_before_switch_left_brace = true
# ij_typescript_space_before_switch_parentheses = true
# ij_typescript_space_before_try_left_brace = true
# ij_typescript_space_before_type_colon = false
# ij_typescript_space_before_unary_not = false
# ij_typescript_space_before_while_keyword = true
# ij_typescript_space_before_while_left_brace = true
# ij_typescript_space_before_while_parentheses = true
# ij_typescript_spaces_around_additive_operators = true
# ij_typescript_spaces_around_arrow_function_operator = true
# ij_typescript_spaces_around_assignment_operators = true
# ij_typescript_spaces_around_bitwise_operators = true
# ij_typescript_spaces_around_equality_operators = true
# ij_typescript_spaces_around_logical_operators = true
# ij_typescript_spaces_around_multiplicative_operators = true
# ij_typescript_spaces_around_relational_operators = true
# ij_typescript_spaces_around_shift_operators = true
# ij_typescript_spaces_around_unary_operator = false
# ij_typescript_spaces_within_array_initializer_brackets = false
# ij_typescript_spaces_within_brackets = false
# ij_typescript_spaces_within_catch_parentheses = false
# ij_typescript_spaces_within_for_parentheses = false
# ij_typescript_spaces_within_if_parentheses = false
# ij_typescript_spaces_within_imports = false
# ij_typescript_spaces_within_interpolation_expressions = false
# ij_typescript_spaces_within_method_call_parentheses = false
# ij_typescript_spaces_within_method_parentheses = false
# ij_typescript_spaces_within_object_literal_braces = false
# ij_typescript_spaces_within_object_type_braces = true
# ij_typescript_spaces_within_parentheses = false
# ij_typescript_spaces_within_switch_parentheses = false
# ij_typescript_spaces_within_type_assertion = false
# ij_typescript_spaces_within_union_types = true
# ij_typescript_spaces_within_while_parentheses = false
# ij_typescript_special_else_if_treatment = true
# ij_typescript_ternary_operation_signs_on_next_line = false
# ij_typescript_ternary_operation_wrap = off
# ij_typescript_union_types_wrap = on_every_item
# ij_typescript_use_chained_calls_group_indents = false
# ij_typescript_use_double_quotes = false
# ij_typescript_use_explicit_js_extension = global
# ij_typescript_use_path_mapping = always
# ij_typescript_use_public_modifier = true
# ij_typescript_use_semicolon_after_statement = true
# ij_typescript_var_declaration_wrap = normal
# ij_typescript_while_brace_force = never
# ij_typescript_while_on_new_line = false
# ij_typescript_wrap_comments = false
[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config}]
# indent_size = 2
# ij_json_keep_blank_lines_in_code = 0
# ij_json_keep_indents_on_empty_lines = false
# ij_json_keep_line_breaks = true
# ij_json_space_after_colon = true
# ij_json_space_after_comma = true
# ij_json_space_before_colon = true
# ij_json_space_before_comma = false
# ij_json_spaces_within_braces = false
# ij_json_spaces_within_brackets = false
# ij_json_wrap_long_lines = false
[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}]
# ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
# ij_html_align_attributes = true
# ij_html_align_text = false
# ij_html_attribute_wrap = normal
# ij_html_block_comment_at_first_column = true
# ij_html_do_not_align_children_of_min_lines = 0
# ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
# ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot
# ij_html_enforce_quotes = false
# ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
# ij_html_keep_blank_lines = 2
# ij_html_keep_indents_on_empty_lines = false
# ij_html_keep_line_breaks = true
# ij_html_keep_line_breaks_in_text = true
# ij_html_keep_whitespaces = false
# ij_html_keep_whitespaces_inside = span,pre,textarea
# ij_html_line_comment_at_first_column = true
# ij_html_new_line_after_last_attribute = never
# ij_html_new_line_before_first_attribute = never
# ij_html_quote_style = double
# ij_html_remove_new_line_before_tags = br
# ij_html_space_after_tag_name = false
# ij_html_space_around_equality_in_attribute = false
# ij_html_space_inside_empty_tag = false
# ij_html_text_wrap = normal
[{*.markdown,*.md}]
# ij_markdown_force_one_space_after_blockquote_symbol = true
# ij_markdown_force_one_space_after_header_symbol = true
# ij_markdown_force_one_space_after_list_bullet = true
# ij_markdown_force_one_space_between_words = true
# ij_markdown_keep_indents_on_empty_lines = false
# ij_markdown_max_lines_around_block_elements = 1
# ij_markdown_max_lines_around_header = 1
# ij_markdown_max_lines_between_paragraphs = 1
# ij_markdown_min_lines_around_block_elements = 1
# ij_markdown_min_lines_around_header = 1
# ij_markdown_min_lines_between_paragraphs = 1
[{*.yaml,*.yml}]
# indent_size = 2
# ij_yaml_align_values_properties = do_not_align
# ij_yaml_autoinsert_sequence_marker = true
# ij_yaml_block_mapping_on_new_line = false
# ij_yaml_indent_sequence_value = true
# ij_yaml_keep_indents_on_empty_lines = false
# ij_yaml_keep_line_breaks = true
# ij_yaml_sequence_on_new_line = false
# ij_yaml_space_before_colon = false
# ij_yaml_spaces_within_braces = true
# ij_yaml_spaces_within_brackets = true

31
.eslintrc.js Normal file
View file

@ -0,0 +1,31 @@
module.exports = {
root: true, // if you want to prevent ESLint from searching for the configuration file all the way up to the root directory of the filesystem
env: {
browser: true, // for ESLint to be aware of browser global variables
node: true, // for ESLint to be aware of Node.js global variables and scoping
es6: true, // for ESLint to be aware of ES6 global variables (this automatically enables ES6 syntax)
},
parser: '@typescript-eslint/parser', // TypeScript (if not Vue)
parserOptions: {
parser: '@typescript-eslint/parser', // Vue + TypeScript
ecmaFeatures: {
jsx: true, // React, React Native
},
sourceType: 'module', // if you're using ECMAScript modules
},
extends: [
'eslint:recommended', // always (set of rules recommended by ESLint team)
'plugin:@typescript-eslint/recommended'
],
rules: {
"@typescript-eslint/no-explicit-any": ["error", { "fixToUnknown": false, "ignoreRestArgs": true }]
},
plugins: [
'@typescript-eslint', // TypeScript
],
settings: {
react: {
version: 'detect', // React
}
}
};

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
node_modules
package-lock.json

8
.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

9
.idea/enchantrix.iml generated Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/misc.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/enchantrix.iml" filepath="$PROJECT_DIR$/.idea/enchantrix.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -1,2 +1,8 @@
# enchantrix
CryptoSuite
# Enchantrix
The Little CryptoSuite that could.
```shell
deno test src/
```
![img.png](.build/img/img.png)

18
deno.json Normal file
View file

@ -0,0 +1,18 @@
{
"compilerOptions": {
"allowJs": true,
"lib": ["deno.window", "deno.unstable"],
"strict": true
},
"lint": {
"files": {
"include": ["src/"],
"exclude": ["src/testdata/"]
},
"rules": {
"tags": ["recommended"],
"include": ["ban-untagged-todo"],
"exclude": ["no-unused-vars"]
}
}
}

43
package.json Normal file
View file

@ -0,0 +1,43 @@
{
"name": "enchantrix",
"version": "0.0.1",
"license": "EUPL-1.2",
"description": "The Little CryptoSuite that could.",
"homepage": "https://github.com/Snider/enchantrix/wiki",
"bugs": {
"url": "https://github.com/Snider/enchantrix/issues",
"email": "snider@lt.hn"
},
"author": "Snider <snider@lt.hn> (https://lt.hn)",
"main": "src/server.ts",
"repository": {
"type": "git",
"url": "https://github.com/Snider/enchantrix"
},
"scripts": {
"dev": "deno run --watch --allow-net --allow-env --allow-run --allow-read --allow-write --unstable src/server.ts",
"lint": "eslint 'src/**/*.{ts,html,scss}' --cache",
"test": "deno test src/ ",
"sdk:angular": "openapi-generator generate -i openapi.json -g typescript-angular -o build/api"
},
"dependencies": {
"ansi_up": "^5.1.0",
"ansi-to-html": "^0.7.2",
"ansicolor": "^1.1.95",
"axios": "^0.24.0",
"i": "^0.3.7",
"npm": "^8.1.2",
"openpgp": "^5.0.0",
"pem-ts": "^3.0.0",
"swagger-jsdoc": "^6.1.0"
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "^2.4.18",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.4.1"
}
}

View file

@ -0,0 +1,18 @@
import { assertEquals } from "https://deno.land/std@0.122.0/testing/asserts.ts";
import {EnchantrixSaltQuasiEntropy} from "./quasi-entropy.ts";
// Compact form: name and function
Deno.test("IN: Snider OUT: redinS", () => {
const x = new EnchantrixSaltQuasiEntropy('Snider').salty();
assertEquals(x, 'redinS');
});
// Compact form: name and function
Deno.test("IN: snider OUT: redins", () => {
const x = new EnchantrixSaltQuasiEntropy('snider').salty();
assertEquals(x, 'redins');
});
Deno.test("Medium Input, Large Salt", () => {
const x = new EnchantrixSaltQuasiEntropy('a long string with spaces and workds and much letters and stuff').salty();
assertEquals(x, 'ffuts dna srettel hcum dna sdkrow dna secaps htiw gnirts gnol a');
});

56
src/salt/quasi-entropy.ts Normal file
View file

@ -0,0 +1,56 @@
/**
* Reproducible salts from input without prior knowledge
*
* @example const salt = new EnchantrixSaltQuasiEntropy('Snider').salty()
*/
export class EnchantrixSaltQuasiEntropy {
/**
* Extend to enforce a custom mapping
*
* @protected
*/
protected charMap = {
'o': '0',
'l': "1",
'e': "3",
'a': "4",
's': "z",
't': "7",
}
protected readonly _input: string = ''
/**
* Supply the input
*
* @param input
*/
constructor(input: string) {
this._input = input
}
get keyMap():any {
return this.charMap
}
/**
*
* @param {string} input
* @returns {string}
*/
salty(): string {
if (!this._input) {
return '';
}
let i: number = this._input.length;
let salt:string[] = []
while (i--) {
salt.push(this._input[i] === this.keyMap[this._input[i]] ? this.keyMap[this._input[i]] : this._input[i]);
}
return salt.join('');
}
}