├── .gitignore ├── Python ├── decrypted_img.png ├── encrypted_img.png ├── lena_std.png └── main.py ├── README.md ├── Tina Models ├── Two Circuits.TSC ├── dual with annotations.png ├── dual.JPG └── single.JPG └── assets ├── 108118095 - Image Encryption Process based on Chaotic Synchronization Phenomena.pdf ├── Image Encryption Process based on Chaotic Synchronization Phenomena.pptx ├── Image encryption process based on chaotic synchronization phenomena.pdf ├── Screenshot-20201115175745-1920x1080.png └── output.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vscode/ 3 | tcurve.txt 4 | *autosave*.TSC 5 | 6 | # Created by .ignore support plugin (hsz.mobi) 7 | ### Python template 8 | # Byte-compiled / optimized / DLL files 9 | __pycache__/ 10 | *.py[cod] 11 | *$py.class 12 | 13 | # C extensions 14 | *.so 15 | 16 | # Distribution / packaging 17 | .Python 18 | build/ 19 | develop-eggs/ 20 | dist/ 21 | downloads/ 22 | eggs/ 23 | .eggs/ 24 | lib/ 25 | lib64/ 26 | parts/ 27 | sdist/ 28 | var/ 29 | wheels/ 30 | share/python-wheels/ 31 | *.egg-info/ 32 | .installed.cfg 33 | *.egg 34 | MANIFEST 35 | 36 | # PyInstaller 37 | # Usually these files are written by a python script from a template 38 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 39 | *.manifest 40 | *.spec 41 | 42 | # Installer logs 43 | pip-log.txt 44 | pip-delete-this-directory.txt 45 | 46 | # Unit test / coverage reports 47 | htmlcov/ 48 | .tox/ 49 | .nox/ 50 | .coverage 51 | .coverage.* 52 | .cache 53 | nosetests.xml 54 | coverage.xml 55 | *.cover 56 | *.py,cover 57 | .hypothesis/ 58 | .pytest_cache/ 59 | cover/ 60 | 61 | # Translations 62 | *.mo 63 | *.pot 64 | 65 | # Django stuff: 66 | *.log 67 | local_settings.py 68 | db.sqlite3 69 | db.sqlite3-journal 70 | 71 | # Flask stuff: 72 | instance/ 73 | .webassets-cache 74 | 75 | # Scrapy stuff: 76 | .scrapy 77 | 78 | # Sphinx documentation 79 | docs/_build/ 80 | 81 | # PyBuilder 82 | .pybuilder/ 83 | target/ 84 | 85 | # Jupyter Notebook 86 | .ipynb_checkpoints 87 | 88 | # IPython 89 | profile_default/ 90 | ipython_config.py 91 | 92 | # pyenv 93 | # For a library or package, you might want to ignore these files since the code is 94 | # intended to run in multiple environments; otherwise, check them in: 95 | # .python-version 96 | 97 | # pipenv 98 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 99 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 100 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 101 | # install all needed dependencies. 102 | #Pipfile.lock 103 | 104 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 105 | __pypackages__/ 106 | 107 | # Celery stuff 108 | celerybeat-schedule 109 | celerybeat.pid 110 | 111 | # SageMath parsed files 112 | *.sage.py 113 | 114 | # Environments 115 | .env 116 | .venv 117 | env/ 118 | venv/ 119 | ENV/ 120 | env.bak/ 121 | venv.bak/ 122 | 123 | # Spyder project settings 124 | .spyderproject 125 | .spyproject 126 | 127 | # Rope project settings 128 | .ropeproject 129 | 130 | # mkdocs documentation 131 | /site 132 | 133 | # mypy 134 | .mypy_cache/ 135 | .dmypy.json 136 | dmypy.json 137 | 138 | # Pyre type checker 139 | .pyre/ 140 | 141 | # pytype static type analyzer 142 | .pytype/ 143 | 144 | # Cython debug symbols 145 | cython_debug/ 146 | 147 | ### JupyterNotebooks template 148 | # gitignore template for Jupyter Notebooks 149 | # website: http://jupyter.org/ 150 | 151 | .ipynb_checkpoints 152 | */.ipynb_checkpoints/* 153 | 154 | # IPython 155 | profile_default/ 156 | ipython_config.py 157 | 158 | # Remove previous ipynb_checkpoints 159 | # git rm -r .ipynb_checkpoints/ 160 | 161 | -------------------------------------------------------------------------------- /Python/decrypted_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syzygianinfern0/Image-Encryption-using-Chaotic-Synchronization/b780b0142439b3b5da1a9af17e6171ab3072e787/Python/decrypted_img.png -------------------------------------------------------------------------------- /Python/encrypted_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syzygianinfern0/Image-Encryption-using-Chaotic-Synchronization/b780b0142439b3b5da1a9af17e6171ab3072e787/Python/encrypted_img.png -------------------------------------------------------------------------------- /Python/lena_std.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syzygianinfern0/Image-Encryption-using-Chaotic-Synchronization/b780b0142439b3b5da1a9af17e6171ab3072e787/Python/lena_std.png -------------------------------------------------------------------------------- /Python/main.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | np.random.seed(0) 5 | 6 | 7 | def quantizer(values): 8 | return np.floor(values) 9 | 10 | 11 | def unpack_bits_to_uint8(bits): 12 | output = [] 13 | for i in range(0, len(bits), 8): 14 | bit_8 = bits[i : i + 8] 15 | output.append(int("".join(str(x) for x in bit_8), 2)) 16 | return np.array(output) 17 | 18 | 19 | def deskewer(bits): 20 | deskewed = [] 21 | for i in range(0, len(bits), 2): 22 | if bits[i] == 0 and bits[i + 1] == 1: 23 | deskewed.append(0) 24 | if bits[i] == 1 and bits[i + 1] == 0: 25 | deskewed.append(1) 26 | return np.array(deskewed) 27 | 28 | 29 | def main(): 30 | input_img = cv2.imread("lena_std.png", cv2.IMREAD_GRAYSCALE) 31 | input_img = cv2.resize(input_img, (64, 64)) 32 | flattened_array = input_img.flatten() 33 | 34 | # random_stream = np.random.random(64 * 64 * 8 * 4) + 0.5 35 | random_stream = str(open(tcurve.txt).read()) 36 | random_bits = quantizer(random_stream) 37 | deskewed_bits = deskewer(random_bits) 38 | deskewed_uint8 = unpack_bits_to_uint8(deskewed_bits) 39 | 40 | encrypted_stream = np.bitwise_xor(flattened_array, deskewed_uint8) 41 | encrypted_img = np.resize(encrypted_stream, (64, 64)) 42 | encrypted_img = encrypted_img.astype(np.uint8) 43 | 44 | decrypted_stream = np.bitwise_xor(encrypted_stream, deskewed_uint8) 45 | decrypted_img = np.resize(decrypted_stream, (64, 64)) 46 | decrypted_img = decrypted_img.astype(np.uint8) 47 | 48 | cv2.namedWindow("input_img", cv2.WINDOW_NORMAL) 49 | cv2.namedWindow("encrypted_img", cv2.WINDOW_NORMAL) 50 | cv2.namedWindow("decrypted_img", cv2.WINDOW_NORMAL) 51 | cv2.imshow("input_img", input_img) 52 | cv2.imshow("encrypted_img", encrypted_img) 53 | cv2.imshow("decrypted_img", decrypted_img) 54 | cv2.waitKey() 55 | cv2.destroyAllWindows() 56 | 57 | cv2.imwrite("encrypted_img.png", encrypted_img) 58 | cv2.imwrite("decrypted_img.png", decrypted_img) 59 | print("Done") 60 | 61 | 62 | if __name__ == "__main__": 63 | main() 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |