HYBRID ENCODING SYSTEM USING BIGINT AND TOTP FOR TEXTUAL DATA AND IMAGE PROTECTION

๐Ÿง  ENCODER-AND-DECODER The BigInt + TOTP Encoder and Decoder is a web-based tool built in HTML and JavaScript that allows users to securely encode and decode text and images using encryption based on large integers (BigInt) and time-based authentication (TOTP โ€“ Time-Based One-Time Password). ๐Ÿงฉ General Functioning The system has four main sections: ๐Ÿ”ค Text Encoder Transforms plain text into an encrypted number (mixedBigInt in hexadecimal) and generates a secret key (TOTP Secret in base32). ๐Ÿ” Text Decoder Reconstructs the original text using the mixedBigInt, the TOTP Secret, and a one-time code generated by an authenticator app (for example, Google Authenticator). ๐Ÿ–ผ๏ธ Image Encoder Compresses and encodes images automatically into approximately 30 pages (~90KB) of hexadecimal text.It supports multiple formats: JPG, PNG, GIF, BMP, WEBP, SVG, TIFF, AVIF, and others.All images are converted to JPEG during the compression process. ๐Ÿงพ Image Decoder Reconstructs the original image using the mixedBigInt, the TOTP Secret, and a valid TOTP code. ๐Ÿ”’ Main Technical Steps The text or image (as base64) is converted into bytes, and then into a very large integer (BigInt). A random secret (20 bytes) is generated and converted into Base32, forming the TOTP Secret. From this secret, the system derives a unique prime number used to mix with the original value โ€” producing the mixedBigInt (encoded data). For images: automatic compression resizes the image to a maximum of 1200px and adjusts JPEG quality dynamically to reach ~90KB, ensuring about 30 pages of hexadecimal text. To decode, the user must provide the mixedBigInt, the TOTP Secret, and a valid TOTP code (which refreshes every 30 seconds). The system validates the TOTP code and, if correct, divides the mixedBigInt by the derived prime to recover the original text or image. โš™๏ธ Main Technologies Used Modern JavaScript (ES6+) Web Crypto API โ€” used for generating HMAC-SHA1 and SHA-256 BigInt โ€” used for operations with extremely large numbers Base32 โ€” ensures compatibility with authenticator apps Canvas API โ€” handles image compression and format conversion ๐Ÿ–ผ๏ธ Image Compression Details Feature Description Supported formats JPG, PNG, GIF, BMP, WEBP, SVG, TIFF, AVIF, and others Automatic resizing Maximum size: 1200px (maintains aspect ratio) Dynamic quality JPEG quality automatically adjusted to target ~90KB Output format All images converted to JPEG Result About 30 pages of hexadecimal text instead of 130+ pages for a 321KB image ๐Ÿ’ก Purpose The goal of this project is to protect textual data and images without transmitting or storing the original secret.It combines mathematical encoding and two-factor authentication (2FA), ensuring that only users who possess both the TOTP Secret and a valid authentication code can decrypt the content. ๐Ÿ” Encode text and image, and then decode using the website below: ๐Ÿ‘‰ https://k10.netlify.app/projetos/text&image๐Ÿ‘‰ https://github.com/andradepsa/ENCODER-AND-DECODER ๐Ÿงฉ STEPS Enter the mixedBigInt (hex) value into the decoder on the website. Enter the TOTP Secret (base32) and input the required characters. Register the TOTP Secret (base32) in your Authenticator app to generate verification codes. โœ… Additions and Enhancements Added image encoding to the system. Included details about supported image formats (JPG, PNG, GIF, BMP, WEBP, SVG, TIFF, AVIF). Explained automatic compression to around 30 pages of hexadecimal data. Noted that all images are converted to JPEG during compression. Added technical information about the Canvas API. Compared file size reduction (321KB โ†’ 90KB).

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2025-10-07
DOI
https://doi.org/10.5281/zenodo.17289037
Primary Topic
African Studies and Ethnography
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

HYBRID ENCODING SYSTEM USING BIGINT AND TOTP FOR TEXTUAL DATA AND IMAGE PROTECTION

Zenodo (CERN European Organization for Nuclear Research)
African Studies and Ethnography
article

HYBRID ENCODING SYSTEM USING BIGINT AND TOTP FOR TEXTUAL DATA AND IMAGE PROTECTION

article en

Abstract

๐Ÿง  ENCODER-AND-DECODER The BigInt + TOTP Encoder and Decoder is a web-based tool built in HTML and JavaScript that allows users to securely encode and decode text and images using encryption based on large integers (BigInt) and time-based authentication (TOTP โ€“ Time-Based One-Time Password). ๐Ÿงฉ General Functioning The system has four main sections: ๐Ÿ”ค Text Encoder Transforms plain text into an encrypted number (mixedBigInt in hexadecimal) and generates a secret key (TOTP Secret in base32). ๐Ÿ” Text Decoder Reconstructs the original text using the mixedBigInt, the TOTP Secret, and a one-time code generated by an authenticator app (for example, Google Authenticator). ๐Ÿ–ผ๏ธ Image Encoder Compresses and encodes images automatically into approximately 30 pages (~90KB) of hexadecimal text.It supports multiple formats: JPG, PNG, GIF, BMP, WEBP, SVG, TIFF, AVIF, and others.All images are converted to JPEG during the compression process. ๐Ÿงพ Image Decoder Reconstructs the original image using the mixedBigInt, the TOTP Secret, and a valid TOTP code. ๐Ÿ”’ Main Technical Steps The text or image (as base64) is converted into bytes, and then into a very large integer (BigInt). A random secret (20 bytes) is generated and converted into Base32, forming the TOTP Secret. From this secret, the system derives a unique prime number used to mix with the original value โ€” producing the mixedBigInt (encoded data). For images: automatic compression resizes the image to a maximum of 1200px and adjusts JPEG quality dynamically to reach ~90KB, ensuring about 30 pages of hexadecimal text. To decode, the user must provide the mixedBigInt, the TOTP Secret, and a valid TOTP code (which refreshes every 30 seconds). The system validates the TOTP code and, if correct, divides the mixedBigInt by the derived prime to recover the original text or image. โš™๏ธ Main Technologies Used Modern JavaScript (ES6+) Web Crypto API โ€” used for generating HMAC-SHA1 and SHA-256 BigInt โ€” used for operations with extremely large numbers Base32 โ€” ensures compatibility with authenticator apps Canvas API โ€” handles image compression and format conversion ๐Ÿ–ผ๏ธ Image Compression Details Feature Description Supported formats JPG, PNG, GIF, BMP, WEBP, SVG, TIFF, AVIF, and others Automatic resizing Maximum size: 1200px (maintains aspect ratio) Dynamic quality JPEG quality automatically adjusted to target ~90KB Output format All images converted to JPEG Result About 30 pages of hexadecimal text instead of 130+ pages for a 321KB image ๐Ÿ’ก Purpose The goal of this project is to protect textual data and images without transmitting or storing the original secret.It combines mathematical encoding and two-factor authentication (2FA), ensuring that only users who possess both the TOTP Secret and a valid authentication code can decrypt the content. ๐Ÿ” Encode text and image, and then decode using the website below: ๐Ÿ‘‰ https://k10.netlify.app/projetos/text&image๐Ÿ‘‰ https://github.com/andradepsa/ENCODER-AND-DECODER ๐Ÿงฉ STEPS Enter the mixedBigInt (hex) value into the decoder on the website. Enter the TOTP Secret (base32) and input the required characters. Register the TOTP Secret (base32) in your Authenticator app to generate verification codes. โœ… Additions and Enhancements Added image encoding to the system. Included details about supported image formats (JPG, PNG, GIF, BMP, WEBP, SVG, TIFF, AVIF). Explained automatic compression to around 30 pages of hexadecimal data. Noted that all images are converted to JPEG during compression. Added technical information about the Canvas API. Compared file size reduction (321KB โ†’ 90KB).

Zenodo (CERN European Organization for Nuclear Research)
Openalex Percentile: Top 37%
African Studies and Ethnography
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.