Skip to content

Instantly share code, notes, and snippets.

View Twilight-Dream-Of-Magic's full-sized avatar

Twilight-Dream-Of-Magical Twilight-Dream-Of-Magic

View GitHub Profile

Hexagonal symmetric encryption and decryption structure and algorithm implementation based on artificial intelligence neural network idea

1. Diagram of the Hexagonal Neural Network Structure

Simple Version

`#` is Empty data

                                PlainText    PlainText
                                       |       |
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
typedef struct
{
uint64_t State[16];
uint64_t UpdatedState[16]; //FSM result
uint64_t TransformedState[16];
/*
Unity Component Requirements: HyperText Mini (Candlelight)
Summary:
This component is based on the Candlelight HyperText version for Unity 2018 or later.
It should allow for the creation and management of interactive and non-interactive texts within the Unity engine.
The component should not rely on TextMeshPro and should be accessible, usable, or editable within the Unity Inspector through the generated code.
Do not use TextMeshPro or any other third-party plugins.
Features:
import numpy as np
from mpmath import mp
# Set the desired decimal precision
mp.dps = 100
# Define the mathematical constants
e = mp.e
pi = mp.pi
phi = (1 + mp.sqrt(5)) / 2
@Twilight-Dream-Of-Magic
Twilight-Dream-Of-Magic / One-way-function2.cpp
Created May 8, 2023 16:14
One way function (version 2) with cryptography
#include <iostream>
#include <NTL/ZZ_pX.h>
#include <NTL/mat_ZZ_p.h>
#include <random>
std::random_device rd;
std::default_random_engine generator(rd());
// Set the PRNG seed
void set_seed(unsigned int seed) {
@Twilight-Dream-Of-Magic
Twilight-Dream-Of-Magic / One-way-function.go
Last active May 3, 2023 12:02
One way function with cryptography
/*
package main
import (
"fmt"
"math/big"
"math/rand"
"time"
)
@Twilight-Dream-Of-Magic
Twilight-Dream-Of-Magic / complier.sh
Created April 14, 2023 03:43
Stream Cipher Weaker Test
#!/use/bin/bash
gcc -std=c++20 ./main.cpp
@Twilight-Dream-Of-Magic
Twilight-Dream-Of-Magic / ByteSubstitutionBoxToolkit.hpp
Last active April 14, 2023 03:51
Twilight-Dream Custom Data Obfuscator
#pragma once
/*
Reference Paper and source code tool kit
https://hal.inria.fr/hal-01400936
*/
namespace CustomSecurity::ByteSubstitutionBoxToolkit
{
using AutoFloatingType = std::conditional_t<CURRENT_SYSTEM_BITS == 32, float, double>;
@Twilight-Dream-Of-Magic
Twilight-Dream-Of-Magic / cpp2020_bitset_utility_library.hpp
Last active April 1, 2022 07:19
C++ 2020 Utility Tools Library - Bitset (Concatenator & Spliter)
#include <bitset>
#include <bit>
#include <pair>
#include <type_traits>
#include <concepts>
#include <limits>
namespace UtilityTools::Bitset
{
template<std::size_t BitsetSize>
@Twilight-Dream-Of-Magic
Twilight-Dream-Of-Magic / mio.hpp
Last active August 10, 2022 05:10
[C++ 2020 template concept support] with repository https://github.com/mandreyel/mio/
/* Copyright 2017 https://github.com/mandreyel
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies