GithubHelp home page GithubHelp logo

lucabongiorni / no-more-secrets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bartobri/no-more-secrets

0.0 2.0 0.0 80 KB

A tool set to recreate the famous "decrypting text" effect as seen in the 1992 movie Sneakers.

License: GNU General Public License v3.0

Makefile 8.76% C 91.24%

no-more-secrets's Introduction

No More Secrets

"No More Secrets" is the name I've lovingly given to the infamous "decrypting text" effect seen on screen in the 1992 hacker movie Sneakers. If you are unfamiliar with the effect, it can be seen at 0:35 in this youtube video.

This project provides tools to recreate this effect in your projects.

Here is a standalone executable called nms (provided in this project) that uses these tools to perform this effect on piped data:

Screenshot

Also included in this project is a program called sneakers that utilizes these tools to recreate, almost identically, what we see in the above movie clip.

Screenshot

What's Provided

Two tools are provided for you to recreate this effect:

  1. A standalone executable file named nms (shown above). This program performs the "decrypting text" effect on data it receives via shell pipe.

  2. A module and header file, written in C, that can be used to recreate this effect in other projects. In fact, the standalone executable nms is really just an example that shows how to use this module with piped data.

Installing the Standalone Executable

First, make sure you have the ncurses library installed:

ls /usr/include | grep ncurses.h

If the ncurses.h header file is not present, you may need to install the library. On Ubuntu, type:

sudo apt-get update
sudo apt-get install ncurses-dev

If you are using a different flavor of linux, search your available packages for "ncurses" and install it.

Next, download and build the standalone executable:

git clone https://github.com/bartobri/no-more-secrets.git
cd ./no-more-secrets
make
sudo make install

This will create and install an executable file nms. (Note that this also installs another executable file named sneakers which is shown above.)

Using the Standalone Executable

nms accepts data from a shell pipe. Simply pipe some data to it and enjoy the magic!

ls -l / | nms

Once the "encrypted" data is displayed, the program will pause until you press a key. Then the decryption effect will start. After that is completed, it will again pause until you press a key, at which point the program will terminate.

Using the Module in Your Program

NOTE: Be sure that you have the ncurses library installed on your system. See "Installing the Standalone Executable" above for more info.

Synopsis

// myprog.c

#include "nms.h"

int main() {
    NmsArgs args = INIT_NMSARGS;

    args.src = "This is a simple test";

    nms_exec(&args);

    return 0;
}

Compile myprog.c (must include nms.c and -lncurses):

gcc nms.c myprog.c -o myprog -lncurses

How-To

Copy these two files to your project:

nms.h
nms.c

Include nms.h in your program file:

#include "nms.h"

Next, declare and initialize the structure that needs to be passed to nms_exec():

NmsArgs args = INIT_NMSARGS;

INIT_NMSARGS is a defined name that assigns a default set of values to all of the structure members. It is recommended that you use it. If you don't, you will have to manually assign a value to each structure member.

Here is how the structure is defined:

typedef struct {
    char *src;
    char *return_opts;
    int input_cursor_x;
    int input_cursor_y;
    bool show_cursor;
} NmsArgs;
  • char *src
    • Pointer to the string of characters on which to perform the effect.

Useful for displaying menus:

  • char *return_opts
    • String pointer containing only the character options that the user must choose from once the src characters are revealed. For example, if you are showing a menu with six options, this string might be "123456". The user will have to choose one of these characters before execution is handed back to the calling function. Note that the character selected is returned by nms_exec();
  • int input_cursor_x and int input_cursor_y
    • If your menu has a specific location that you'd like to place the cursor for user input, use these to set the x and y screen coordinates for the position.
  • bool show_cursor
    • Set to true if you want the cursor to be visible during the text decryption effect. It is set to false by default.

Assign values to the structure members as needed. Then simply pass a pointer to the structure to the nms_exec() function:

nms_exec(&args);

Note that nms_exec() prompts the user to press a key to start the "decrypting text" effect, and again once the text has been fully revealed. The key that is pressed at the second prompt is returned to the calling function so that it can be used as input after displaying a menu.

Compiling

Add nms.c to your source file list, and link the ncurses library -lncurses when compiling:

gcc nms.c myprog.c -o myprog -lncurses

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. See COPYING for more details.

no-more-secrets's People

Contributors

bartobri avatar apjanke avatar maxwellgerber avatar corazzi avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.