Skip to content

Python-based implementation to generate Proof of Work (PoW) tokens and Sentinel tokens for bypassing security mechanisms in OpenAI's ChatGPT and Sora private APIs

Notifications You must be signed in to change notification settings

leetanshaj/openai-sentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI Sentinel Token Generator

This repository provides a Python-based implementation to generate Proof of Work (PoW) tokens and Sentinel tokens for bypassing security mechanisms in OpenAI's ChatGPT and Sora private APIs. By reverse engineering the browser's token generation process, this project enables programmatic access to these APIs without requiring manual interaction or browser-based token generation.

Table of Contents


Overview

OpenAI's private APIs, such as ChatGPT and Sora, use advanced security mechanisms like Proof of Work (PoW) and Sentinel tokens to prevent unauthorized access. These tokens are typically generated in the browser using a combination of cryptographic hashing, unique identifiers, and environmental data.

This project reverse-engineers the token generation process to allow developers to programmatically generate these tokens and interact with the APIs directly. This can be useful for automation, testing, or research purposes.


Features

  • Proof of Work Token Generation: Implements a hashing-based PoW mechanism to generate valid tokens.
  • Sentinel Token Generation: Creates Sentinel tokens required for API authentication.
  • Reverse-Engineered Browser Behavior: Mimics browser-specific configurations and environmental data.
  • Customizable: Easily modify configurations like user agents, navigator keys, and more.

How It Works

Proof of Work (PoW) Token Generation

The PoW token is generated by solving a computational challenge. The process involves:

  1. Generating a random seed and difficulty level.
  2. Iteratively hashing the seed with encoded configuration data until the hash meets the difficulty criteria.
  3. Returning the solution as a base64-encoded string.

The implementation is in proof_of_work.py, which uses cryptographic hashing (sha3_512) and base64 encoding to generate the token.

Sentinel Token Generation

The Sentinel token is generated by:

  1. Fetching API requirements using the PoW token.
  2. Parsing the API response to extract necessary fields like turnstile and token.
  3. Constructing a payload with the extracted data and generating the final Sentinel token.

The implementation is in sentinel_token.py, which handles API communication and token generation.


Installation

  1. Clone the repository:
    git clone https://github.com/your-username/openai-sentinel.git
    cd openai-sentinel
  2. Install the required dependencies:
    pip install -r requirements.txt
    Ensure you have Python 3.8 or higher installed.

Usage

Generating a Proof of Work (PoW) Token

To generate a PoW token, run the following command:

python proof_of_work.py

This will output a valid PoW token that can be used for API authentication.

Generating a Sentinel Token

To generate a Sentinel token, run the following command:

python sentinel_token.py

This will output a valid Sentinel token that can be used for API authentication.


File Structure

openai-sentinel/
├── proof_of_work.py
├── sentinel_token.py
├── config.py
├── requirements.txt
├── README.md

Key Files:

  • proof_of_work.py: Contains the implementation for generating PoW tokens.
  • sentinel_token.py: Contains the implementation for generating Sentinel tokens.
  • config.py: Configuration file for user agents, navigator keys, and other settings.
  • requirements.txt: Lists the required Python packages.
  • README.md: This documentation file.

Disclaimer

This project is intended for educational and research purposes only. The use of this code to bypass security mechanisms or access APIs without authorization may violate the terms of service of OpenAI or other third-party services. Use at your own risk, and ensure compliance with all applicable laws and regulations.

Please do not use this code for malicious purposes or to infringe on the rights of others. The author and contributors are not responsible for any misuse or damage caused by the use of this code.

About

Python-based implementation to generate Proof of Work (PoW) tokens and Sentinel tokens for bypassing security mechanisms in OpenAI's ChatGPT and Sora private APIs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages