Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.
|
|
| 2010-09-26, 11:41 | [GM8-GML] RSA Algorithm |
---|
bungatepijalan Moe Princess
Posts : 1487 Thanked : 30 Engine : Multi-Engine User Skill : Intermediate Type : Developer
Awards:
| - Overview:
Ga mau dan takut kalo file game save-nya dihack? Butuh cara & algoritma enkripsi yang paling ampuh dan terjamin aman? RSA Algorithm is the answer!
Script: modX - Code:
-
//modX(a,b,p) : power(a,b) mod p if(argument1<=2){ return power(argument0,argument1) mod argument2; }else if(argument1 mod 2==0){ return (modX(argument0,argument1/2,argument2)*modX(argument0,argument1/2,argument2)) mod argument2 }else{ return (modX(argument0,argument1-1,argument2)*modX(argument0,1,argument2)) mod argument2 } Script: generatePublicKeys - Code:
-
//generatePublicKeys(e) //where e is a public key that is relatively prime to m a=23 b=11 global.n=a*b global.m=(a-1)*(b-1) global.e=argument0 k=1 while((1+k*global.m) mod global.e<>0){ k+=1 } global.d=(1+k*global.m)/global.e Script: encrypt - Code:
-
//encrypt(input_file,output_file) fileid=file_bin_open(argument0,0) fileido=file_bin_open(argument1,1) file_bin_rewrite(fileido) if(file_bin_size(fileid) mod 2 !=0){ ba=file_bin_read_byte(fileid) file_bin_write_byte(fileido,~ba) } do{ ba=file_bin_read_byte(fileid) bb=file_bin_read_byte(fileid) bc=ba mod 16 ba=(ba div 16)*16+bb div 16 bb=bc*16+bb mod 16 ba=modX(ba,global.e,global.n) bb=modX(bb,global.e,global.n) file_bin_write_byte(fileido,ba) file_bin_write_byte(fileido,bb) }until (file_bin_position(fileid)>file_bin_size(fileid)-1) file_bin_close(fileid) file_bin_close(fileido) Script: decrypt - Code:
-
//decrypt(input_file,output_file) fileid=file_bin_open(argument0,0) fileido=file_bin_open(argument1,1) file_bin_rewrite(fileido) if(file_bin_size(fileid) mod 2 !=0){ ba=file_bin_read_byte(fileid) file_bin_write_byte(fileido,~ba) } do{ ba=file_bin_read_byte(fileid) bb=file_bin_read_byte(fileid) ba=modX(ba,global.d,global.n) bb=modX(bb,global.d,global.n) bc=ba mod 16 ba=(ba div 16)*16+bb div 16 bb=bc*16+bb mod 16 file_bin_write_byte(fileido,ba) file_bin_write_byte(fileido,bb) }until (file_bin_position(fileid)>file_bin_size(fileid)-1) file_bin_close(fileid) file_bin_close(fileido) Fungsi: mengenkripsi & mendekripsi data ke/dari suatu file input, termasuk utk save game & load game
Cara pemasangan: - Buat empat script baru, kasi nama modX, generatePublicKeys, encrypt dan decrypt - Copas masing-masing bagian code di atas ke masing2 script tersebut - Implementasikan script-script tersebut (kecuali modX) ke action Execute a piece of code seperti contoh di berikut ini (tergantung penggunaan file). Untuk fungsi generatePublicKeys, masukkan suatu nilai kunci publik e dengan syarat e harus relatif prima terhadap m (FPB dari e dan m sama dengan 1).
Implementasi Contoh: Misalkan sebuah file terenkripsi bernama f.txt didekripsi dengan file keluaran bernama g.txt, dan isi file g.txt akan ditampung dalam string ss (yang nantinya ditampilkan). Setelah selesai, g.txt akan dihapus untuk menjaga kerahasiaan. Maka di bagian actions tambahkan action Execute a piece of code, dan isi dengan kode sebagai berikut: - Code:
-
generatePublicKeys(19) //if(file_exists("e.txt"))encrypt("e.txt","f.txt") decrypt("f.txt","g.txt") ss="" fileid=file_bin_open("g.txt",0) do{ ba=file_bin_read_byte(fileid) ss+=chr(ba) }until (file_bin_position(fileid)>file_bin_size(fileid)-1) file_bin_close(fileid) file_delete("g.txt") Di sini kita gunakan kunci public e=19. Sebagai langkah awal, kita buat enkripsi dari file teks yang bernama e.txt, dengan menghilangkan komen pada kode di atas (baris kedua).
Guarantee: Dijamin 99,9% aman dan super too difficult to hack!!!
Created by: Bunga Tepi Jalan
Credits - http://en.wikipedia.org/wiki/RSA - http://www.givemethecode.com
NB: Lihat konsep dan prinsip Algoritma RSA di: http://prodig.forumotion.net/programming-f28/programming-cryptography-rsa-algorithm-t74.htm
Terakhir diubah oleh bungatepijalan tanggal 2010-10-01, 21:04, total 5 kali diubah (Reason for editing : kode sudah dibuat XD) |
| | | 2010-09-29, 11:15 | Re: [GM8-GML] RSA Algorithm |
---|
bungatepijalan Moe Princess
Posts : 1487 Thanked : 30 Engine : Multi-Engine User Skill : Intermediate Type : Developer
Awards:
| TADAAA... Kodenya sudah dibuat Dan coba-cobalah enkripsi file txt Anda.. |
| | | 2010-09-29, 20:50 | Re: [GM8-GML] RSA Algorithm |
---|
KID_VX Senior
Posts : 959 Thanked : 24 Engine : Multi-Engine User Skill : Very Beginner Type : Developer
| Keren banget, sayang wa bukan pengguna GM |
| | | 2010-09-29, 21:03 | Re: [GM8-GML] RSA Algorithm |
---|
Vsio Xutix Xox
Posts : 2377 Thanked : 18 Engine : Multi-Engine User Skill : Advanced Type : Developer
| | | | 2010-09-29, 21:17 | Re: [GM8-GML] RSA Algorithm |
---|
bungatepijalan Moe Princess
Posts : 1487 Thanked : 30 Engine : Multi-Engine User Skill : Intermediate Type : Developer
Awards:
| | | | 2010-09-30, 16:00 | Re: [GM8-GML] RSA Algorithm |
---|
KID_VX Senior
Posts : 959 Thanked : 24 Engine : Multi-Engine User Skill : Very Beginner Type : Developer
| btw filenya slain di encrypt, di compress juga ga? :cupu: |
| | | 2010-09-30, 17:38 | Re: [GM8-GML] RSA Algorithm |
---|
bungatepijalan Moe Princess
Posts : 1487 Thanked : 30 Engine : Multi-Engine User Skill : Intermediate Type : Developer
Awards:
| Ya enggaklah.. script ini kan cuma mengubah tiap2 karakter menjadi karakter terenkripsi.. dan juga tidak mengubah ukuran bytesnya. Jadi ga mungkin & gada hubungannya ama kompresi... Kompresi punya algoritmanya sendiri.. |
| | | 2010-10-01, 12:05 | Re: [GM8-GML] RSA Algorithm |
---|
hyperkudit Pahlawan Super
Posts : 2288 Thanked : 30 Engine : RMXP Skill : Very Beginner Type : Artist
Awards:
| wew... keren kayaknya... tapi sayang saya bukan pengguna GM.. bisa bikinin hackshield buat rmxp?? |
| | | 2010-10-01, 20:40 | Re: [GM8-GML] RSA Algorithm |
---|
bungatepijalan Moe Princess
Posts : 1487 Thanked : 30 Engine : Multi-Engine User Skill : Intermediate Type : Developer
Awards:
| Maap gan.. aq bukan ahli hacking nih.. :cupu: |
| | | 2010-10-19, 15:49 | Re: [GM8-GML] RSA Algorithm |
---|
Rei_Fan49 Ex-Scripter
Posts : 304 Thanked : 15 Engine : Multi-Engine User Skill : Advanced Type : Scripter
| @bunga: anyway ini script buatan km sendiri? kalo iya, minta ijin buat rubah ke ruby. (Marshal masih bisa dihack sama aku soalnya ) (kalo dibolehin, ntar aku post scriptnya.. soalnya udah jadi) |
| | | | Re: [GM8-GML] RSA Algorithm |
---|
Sponsored content
| | | | Similar topics | |
|
Similar topics | |
| |
Halaman 1 dari 1 | |
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
Latest 10 Topics | [Web Novel] Gloria Infidelis 2016-11-17, 21:27 by LightNightKnight
[Announcement] Forum baru untuk RMID 2016-08-25, 16:39 by TheoAllen
Where I'm Wrong ? 2016-07-24, 16:10 by ReydVires
flakeheartnet's Resources part III 2016-07-08, 14:30 by flakeheartnet
Keira's Art Warehouse 2016-06-28, 19:27 by KeiraBlaze
Theo Core Time System + Bingung 2016-06-27, 16:24 by Lockin
Error Script, Maybe ? 2016-06-27, 16:20 by Lockin
Nusaimoe @ RMID Lounge 2016-06-21, 05:02 by Jihad Bagas
Call Random Battle 2016-06-15, 17:04 by Lockin
Flakeheartnet Resources Part II [come back gift] 2016-06-07, 15:51 by flakeheartnet
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|
|
|