I tried to automatically generate a password with Python3

Introduction

Hello, this is Snakeseed. Today, I made an automatic password generator using Python's built-in variable "chr", so I will share it. It's difficult to use other than the alphabet password, but it's still interesting so I made it. Is it hard to remember? That's okay ...

I will generate various passwords.

How to read this article

This article, in fact, is making something called "practicality". Practicality ★★ ...... I wonder where to use it ⭐️ ★ ..... Can be used ⭐️⭐️ ...... Can be used anywhere There are three stages.

Execution environment

Python 3 from Paiza.IO.

Kanji password

I asked @shiracamus to tell me the random `` `choice``` and corrected it.

import random

l = range(11936, 12000)
n = 20  #Password length
x = ''.join(chr(random.choice(l)) for _ in range(n))
print(x)

Practicality ★★ This is not a Japanese kanji in the first place, so it is difficult for other people to remember it, not to mention those who can only speak Japanese.

Alphabet password

Only lowercase

import random

l = range(96, 123)
n = 20  #Password length
x = ''.join(chr(random.choice(l)) for _ in range(n))
print(x)

Only uppercase

Practicality ⭐️ ★

Bonus: Appropriate version

The first one

Password example

؃جأؠب؉؊ׯ؊פײزس׭جـؐװײا
⇲⇷∁⇖⇶∖∇⇯∞∂∉⇻⇩∙√∑⇟∠⇤⇕

As you can see, it's anything. Hangul and Kanji are not included (should be).

import random

l = range(1000, 10000)
n = 20  #Password length
x = ''.join(chr(random.choice(l)) for _ in range(n))
print(x)

Practicality ★★

Second

Password example

䭖 䭏 䬹 䭐 䬪 䬩 䬯 䬤 䭋 䬼 䭆 䭑 䭝 䭛 䭋 䬴 䭘 䬺 䬏 䬕

It also seems to make sense. (Google Translate)

웕욫웕욹욤웁욷웉욝웢욵욵욣욎욤욘욵욑웚웥

Mostly kanji. (Because there are many characters) As you can see, it's anything. * Hangul and Kanji are also included. *

import random

l = range(1000, 70000)
n = 20  #Password length
x = ''.join(chr(random.choice(l)) for _ in range(n))
print(x)

Practicality ★★

References

Qiita

Other

-Unicode version character code table -[python] Create a list of various character types

Note

Posted on Saturday, December 26, 2020 at 19:22

Recommended Posts

I tried to automatically generate a password with Python3
I tried to automatically generate a character string to be input to Mr. Adjustment with Python
I tried to draw a route map with Python
[Python] Generate a password with Slackbot
[Outlook] I tried to automatically create a daily report email with Python
I tried to automatically create a report with Markov chain
I tried a functional language with Python
[Python] I tried to automatically create a daily report of YWT with Outlook mail
A memorandum when I tried to get it automatically with selenium
[3rd] I tried to make a certain authenticator-like tool with python
[Python] A memo that I tried to get started with asyncio
I tried to make a periodical process with Selenium and Python
I tried to make a 2channel post notification application with Python
I tried to make a todo application using bottle with python
[4th] I tried to make a certain authenticator-like tool with python
[1st] I tried to make a certain authenticator-like tool with python
I tried to automatically collect images of Kanna Hashimoto with Python! !!
I want to make a game with Python
I tried to get CloudWatch data with Python
I tried to output LLVM IR with Python
Try to automatically generate Python documents with Sphinx
I tried to automate sushi making with python
I tried to generate a random character string
I want to write to a file with Python
I tried to automatically generate OGP of a blog made with Hugo with tcardgen made by Go
I tried fp-growth with python
I tried scraping with Python
Python: I tried to make a flat / flat_map just right with a generator
I tried to communicate with a remote server by Socket communication with Python.
I made a tool to automatically browse multiple sites with Selenium (Python)
I tried to create a program to convert hexadecimal numbers to decimal numbers with python
I tried to make a traffic light-like with Raspberry Pi 4 (Python edition)
I tried to discriminate a 6-digit number with a number discrimination application made with python
I tried gRPC with Python
I tried scraping with python
I tried to build a Mac Python development environment with pythonz + direnv
I tried to create a table only with Django
I tried to read and save automatically with VOICEROID2 2
I want to generate a UUID quickly (memorandum) ~ Python ~
I tried to implement Minesweeper on terminal with python
I tried to get started with blender python script_Part 01
I tried to touch the CSV file with Python
I tried to solve the soma cube with python
I tried to implement a pseudo pachislot in Python
I tried to automatically read and save with VOICEROID2
I tried to generate ObjectId (primary key) with pymongo
I tried to implement an artificial perceptron with python
I tried to solve the problem with Python Vol.1
I tried to analyze J League data with Python
I want to run a quantum computer with Python
I tried to solve AOJ's number theory with Python
I tried to make a simple mail sending application with tkinter of Python
[Patent analysis] I tried to make a patent map with Python without spending money
When I tried to create a virtual environment with Python, it didn't work
[ES Lab] I tried to develop a WEB application with Python and Flask ②
I tried to automatically generate a port management table from Config of L2SW
I tried to easily create a fully automatic attendance system with Selenium + Python
I tried to automatically send the literature of the new coronavirus to LINE with Python
I tried to touch Python (installation)
I made a fortune with Python.
I want to debug with Python