Giter VIP home page Giter VIP logo

regen's Introduction

Regen

๐ŸŒŒ LCG-RNG reverser for the Java programming language. The library is able to reverse-engineer the internal state of any linear congruential pseudo-random number generator. Works by finding integer solutions to a system of linear inequalities on consecutive random calls.

Features

  • ๐Ÿ”ฅ Simple and Convenient API
  • ๐Ÿ’ป Multithreading Support
  • ๐Ÿ“ Rich Linear Algebra Library
  • ๐Ÿ’จ Uncompromised Performance

Getting Started

Prerequisites

Gradle

repositories {
    maven {
        url 'https://jitpack.io'
    }
}

dependencies {
    implementation 'com.github.rayferric:regen:1.0.1'
}

Example

Random random = new Random(314159265359L);
RandomReverser reverser = new RandomReverser();

for(int i = 0; i < 30; i++) {
	int value = random.nextInt(256);
	int min = Math.max(value - 16, 0);
	int max = Math.min(value + 16, 255);
	RandomCall call = new JavaIntegerRangeCall(256, min, max);

	// For optimal performance, further calls should be registered in filter-only mode:
	if(i < 15)
		reverser.addCall(call);
	else
		reverser.addFilter(call);

	// Unmeasured calls can be skipped:
	random.nextBoolean();
	reverser.skip(JavaBooleanCall.SKIPS);
}

// The default Java RNG automatically scrambles the seed using XOR:
reverser.solve(LCG.JAVA).map(LCG.JAVA::scramble).forEach(System.out::println);

About

Authors

License

This project is licensed under the MIT License. See the LICENSE file for details.

regen's People

Contributors

rayferric avatar

Watchers

 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.