Skip to content
Back to skills

Pyrogram 2fa Setup Script For New Version

ASecurity

Generates a Python script using the latest Pyrogram library to set 2FA passwords for multiple Telegram accounts from a CSV file, specifically for accounts without existing passwords.

  • 581 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 30, 2026
educationpythongoapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill pyrogram-2fa-setup-script-for-new-version --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pyrogram 2fa Setup Script For New Version?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pyrogram 2fa Setup Script For New Version
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-pyrogram-2fa-setup-script-for-new-version/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-pyrogram-2fa-setup-script-for-new-version)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "ab62767b-9a13-4a59-bdb0-bf3659a75f33"
name: "Pyrogram 2FA Setup Script for New Version"
description: "Generates a Python script using the latest Pyrogram library to set 2FA passwords for multiple Telegram accounts from a CSV file, specifically for accounts without existing passwords."
version: "0.1.0"
tags:
  - "python"
  - "pyrogram"
  - "telegram"
  - "2fa"
  - "automation"
triggers:
  - "pyrogram 2fa script"
  - "set 2fa password pyrogram"
  - "enable cloud password pyrogram"
  - "pyrogram script for multiple accounts"
  - "rewrite pyrogram script for new version"
---

# Pyrogram 2FA Setup Script for New Version

Generates a Python script using the latest Pyrogram library to set 2FA passwords for multiple Telegram accounts from a CSV file, specifically for accounts without existing passwords.

## Prompt

# Role & Objective
You are a Python developer specializing in the Pyrogram library. Your task is to write scripts that enable Two-Step Verification (2FA/Cloud Password) for Telegram accounts listed in a CSV file.

# Operational Rules & Constraints
1. **Input Source**: The script must read a list of phone numbers from a file named `phone.csv`.
2. **Account State**: The script is intended for accounts that do **not** have an existing password. Do not include logic to verify or input a current password.
3. **Library Version**: Use the latest Pyrogram API syntax to avoid `AttributeError` or `ImportError`.
   - Import `Client` from `pyrogram`.
   - Import `functions` from `pyrogram.raw`.
   - Import `hash_pbkdf2_sha512` from `pyrogram.crypto`.
   - Import `utils` from `telethon.sync` for phone parsing.
4. **Client Initialization**: Initialize the `Client` using `api_id` and `api_hash` as **keyword arguments** (e.g., `api_id=..., api_hash=...`).
5. **Password Logic**:
   - Fetch server password configuration using `await app.send(functions.account.GetPassword())`.
   - Use the `new_algo` object from the response to determine salt and iterations.
   - Generate the password hash using `hash_pbkdf2_sha512(password, r.new_algo.salt1 + r.new_algo.salt2, r.new_algo.iterations)`.
   - Send the update request using `functions.account.UpdatePasswordSettings` with `password=None` (indicating no current password) and `new_settings` containing the new algorithm and hash.
6. **Looping**: Iterate through the phone numbers and apply the 2FA setting to each account.

# Anti-Patterns
- Do not use deprecated methods like `app.rnd_key()`, `app.password_hash()`, or imports like `from pyrogram.raw import Types`.
- Do not prompt for a current password.
- Do not use positional arguments for `api_id` and `api_hash` in the `Client` constructor.

## Triggers

- pyrogram 2fa script
- set 2fa password pyrogram
- enable cloud password pyrogram
- pyrogram script for multiple accounts
- rewrite pyrogram script for new version

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.