Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[python] Base64 encrypt & decrypt
#1
coding python buat encrypt ama decrypt Base64
langsung cek this out *_*


Code:
#!/usr/bin/python # work di python 2.x # promina.py import os, sys from base64 import standard_b64encode, standard_b64decode #bersih-bersih :v if sys.platform == 'linux-i386' or sys.platform == 'darwin' or sys.platform == 'linux2': sysCommand = 'clear' elif sys.platform == 'win32' or sys.platform == 'ms-dos' or sys.platform == 'dos': sysCommand = 'cls' else: sysCommand = 'jancok' #input def promina() : os.system(sysCommand) print '|===================|' print ' ' print '\n1. Base64 Decrypt ' print '\n2. Base64 Encrypt ' print '\n3. Keluar ' print ' ' print '|===================|' Masuk = raw_input('\n\nMasukan Pilihan: ') if (Masuk == '1'): prenagen() elif (Masuk == '2'): sule() elif (Masuk == '3'): os.system(sysCommand) sys.exit(1) else: Promina() #encode def sule() : os.system(sysCommand) masuk = raw_input("\nMasukan string: ") try: crut = standard_b64encode(masuk) print '\n',masuk,' = ',crut print ' ' file = open("sementara.txt", "a") file.write(crut) file.close() except: os.system(sysCommand) print 'ITU NGGAK BISA SETAN !!!' sys.exit() simpan = raw_input('Simpan hasil encode ? (y/n) : ') os.system(sysCommand) if (simpan == 'y'): f = open("encode.txt", "a+") f.write("\n") f.write(standard_b64encode(masuk)) f.close os.system(sysCommand) print '\nfile disimpan di encode.txt' elif (simpan == 'n'): sys.exit() else : os.system(sysCommand) print 'JANCOK,MASUKIN PILIHAN YANG ADA !!!' prikitiw() #Decode def prenagen() : os.system(sysCommand) masuk = raw_input("\nMasukan string : ") try: hasil = standard_b64decode(masuk) print '\n',masuk,' = ',hasil print ' ' file = open("sementawis.txt", "a") file.write(hasil) file.close() except: print 'ITU NGGAK BISA SETAN!!!' sys.exit() nyimpan = raw_input('Simpan hasil Decode ? (y/n) : ') os.system(sysCommand) if (nyimpan == 'y'): f = open("decode.txt", "a+") f.write("\n") f.write(standard_b64decode(masuk)) f.close os.system(sysCommand) print '\nfile berhasil disimpan di decoded.txt' elif (nyimpan == 'n'): sys.exit() else: os.system(sysCommand) print 'JANCOK,MASUKIN PILIHAN YANG ADA !!!' prakataw() #ulangi encode def prikitiw() : masuk = raw_input('\nUlang Lagi? (y/n) : ') if (masuk == 'y'): sule() elif (masuk == 'n'): promina() else: prikitiw() #ulangi decode def prakataw() : masuk = raw_input('\nUlang Lagi? (y/n) : ') if (masuk == 'y'): prenagen() elif (masuk == 'n'): promina() else: prakataw() promina()


Code:
python promina.py

Sekian *_*


Reply
#2
HN coder Ngakak

kwkw mantab bro
kalo di php lebih mudah
tinggal
<?php
echo base64_encode('text yg mau di encode');
?>

mantab lah bro untuk pembelajaran Ngakak
=====================
im back
Reply
#3
(07-07-2011, 12:18 AM)Dika_xb Wrote: HN coder Ngakak

kwkw mantab bro
kalo di php lebih mudah
tinggal
<?php
echo base64_encode('text yg mau di encode');
?>

mantab lah bro untuk pembelajaran Ngakak

ini juga intinya cuman ini doang kok
Ngakak
crut = standard_b64encode(masuk) <<<=== encode
hasil = standard_b64decode(masuk) <<<<=== decode
Ngakak
masih tahap belajar bro Ngakak
Reply
#4
nyoba nyicip ah Ngakak
share nya lumayan buat pemula kaya gw Ganteng
Reply
#5
(07-07-2011, 06:17 PM)NeutronX Wrote: nyoba nyicip ah Ngakak
share nya lumayan buat pemula kaya gw Ganteng

Silahkan bro
Ganteng
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Yuki Onna DHCP ( PYTHON ) Mbah Roni 2 46 08-08-2014, 06:02 AM
Last Post: Wong Deso
  Share Buku Python y3d0wn 39 1,504 07-12-2014, 01:05 AM
Last Post: OneCThree
  CODE BUAT KALKUATOR SEDERHANA DI PYTHON ./N4BIL 4 89 07-01-2014, 03:17 PM
Last Post: OneCThree
  Perulangan Pada Python mydisha 6 77 05-29-2014, 01:48 AM
Last Post: mydisha
  [Share] Scanning SQLi, XSS, LFI, RFI pakai Python blAnk_pag3 17 504 02-15-2014, 11:03 PM
Last Post: kasihputih
  md5 cracker in python jincorn 2 132 11-10-2012, 02:53 AM
Last Post: ulZaAceh
Radioactive_16 Brute Force Facebook password with python th3_pun1sh3r 18 552 11-10-2012, 12:24 AM
Last Post: [H2]

Forum Jump:


Users browsing this thread: 2 Guest(s)