J
J
Jairman2020-05-07 18:13:20
Python
Jairman, 2020-05-07 18:13:20

How to make paid access to the application using a unique key?

How to make subscription access for a PC application with these keys 2B6D5-L6PQK-Q6TVI
Such keys are implemented in Steam to activate games, I also saw this when activating windows, autocad and similar applications.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Karbivnichy, 2020-05-07
@Jairman

Copy-paste to generate such keys (not mine, just googled):

import string
import random
import os
try:
    os.system('clear')
except:
    os.system('cls')
print('Steam Key Generator by DiraFun')

while True:
    try:
        kol_vo = int(input('Сколько steam ключей сгенерировать?: '))
    except ValueError:
        print('Это не похоже на число...')
        time.sleep(2)
        continue
    act = input('Когда я закончу, что сделать с ключами?: \n1 - Сохранить в txt файл\n2 - Вывести на экран\nВаш ответ: ')
    set_act = ['1','2']
    result_act = act in set_act
    while result_act != True:
        print('Я не умею это делать...\n1 - Сохранить результат в .txt файл\n2 - Показать результат на экране')
        act = input('Напиши еще раз что мне сделать: ')
        result_act = act in set_act
    if act == '1':
        name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
        full_name = name + '_result.txt'
        file_12 = open(full_name, mode='w+')
        file_12.close()
        with open(full_name, mode='r+') as file:
            i = 0
            for i in range(kol_vo):
                c1 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
                c2 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
                c3 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
                result = c1 + '-' + c2 + '-' + c3 + '\n'
                file.write(result)
        print('Я все сохранил в этот файл:', full_name)
        print('Найти его можно в папке со скриптом ')
        input('Что бы закончить работу гениратора нажми Enter')
        break
    if act == '2':
        i = 0
        for i in range(kol_vo):
            c1 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
            c2 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
            c3 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
            result = c1 + '-' + c2 + '-' + c3
            print(result)
        input('Что бы закончить работу гениратора нажми Enter')
        break

Output:
MO1AX-6EHRN-3CHG7
14PEB-2I0QG-O5U4D
AQXXR-UWUWS-1NDZF
TXSTC-HQMOK-OBE45
4FNR8-1082F-AX126
...

V
Vladimir Korotenko, 2020-05-07
@firedragon

generate a key
check the key
grant access
What is the question?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question