Akis Forum

Welcome to AkisForum.com! Register your free account today and become a member! Once signed in, you'll be able to dive into learning to code, discovering new tools, and keeping up with the latest trends. AkisForum is where benefit, knowledge, and sharing come together. Join us to add your own topics and posts, and connect with other members through your private inbox!

🎲 [Python] Rastgele Şifre Üreteci

sefack

Member
Akisor
Açıklama:
🔐 Güçlü ve güvenli rastgele şifreler oluşturmak için basit bir Python programı. İstediğiniz uzunlukta, büyük/küçük harf, rakam ve özel karakterlerden oluşan şifreler üretir.


Kodlar:
sifre_uretici.py

Python:
import random
import string

def sifre_uret(uzunluk=12):
    karakterler = string.ascii_letters + string.digits + string.punctuation
    sifre = ''.join(random.choice(karakterler) for _ in range(uzunluk))
    return sifre

def main():
    print("🔐 Rastgele Şifre Üreteci")
    while True:
        try:
            uzunluk = int(input("Şifre uzunluğunu girin (8-32): "))
            if 8 <= uzunluk <= 32:
                break
            else:
                print("Lütfen 8 ile 32 arasında bir sayı girin.")
        except ValueError:
            print("Geçerli bir sayı girin.")

    yeni_sifre = sifre_uret(uzunluk)
    print(f"Oluşturulan şifre: {yeni_sifre}")

if __name__ == "__main__":
    main()
 
Geri
Üst