ss
| RSS | RSS Forum | AboutUS |
Disarankan menggunakan browser selain Internet Explorer, resolusi minimal 1024x768
...
UserName:
PassWord:
     Lost?
Daftar jadi Anggota !
 


stress? deadline kelewat?
bos ngamuk? pc meledak?
masuk sini !


OpenID

(?)

e.g. myname.myhost.com


Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
LAST FORUM POSTS
goto Post[AKS] Gimana cara bikin file log(1)
 by mas_kofa
 on 09. Jan at 23:40
goto Postbackup database(2)
 by bimo_ganteng
 on 09. Jan at 18:33
goto PostCopy otomatis kedalam folder yang dbuat secara otomatis(6)
 by arjuna_1982
 on 09. Jan at 17:44
goto PostReportBuilder + Teechart Support(2)
 by wildan_m
 on 09. Jan at 13:28
goto Postcomponen menampilkan *.doc atau *.Pdf(0)
 by hafiezd
 on 09. Jan at 12:51
goto PostFormat DBEdit dengan Accesss(3)
 by LuriDarmawan
 on 09. Jan at 11:43
goto PostMohon Pertimbangan dan sarannya(12)
 by supermuam
 on 09. Jan at 08:54

[Access Forum]


Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
CurutZOffline
Post subject: help me buat rsa .........  PostPosted: 18-01-2008 11:18
onNovice


Joined: 06-11-2006 09:02
Posts: 13

Status: Offline
maaf jika udah ada yang seperti ini
help me dunkzzzz......
ada dapat tugas nech.........
disuruh buat tugas rsa mulai dari
a pembangkitan prima p dan q
b mencari prima relatif

ada gak source buat prima ??
coz waktu download hanya

Code:
Program Bilangan_Prima;
uses crt;
var a,b,c,d,e:longint;
begin clrscr;
write('bilangan prima sampai berapa? '); readln(c);
writeln('2':7);
for a:=3 to c do
begin
for b:= 2 to a-1 do
begin
if a mod b = 0 then begin
d:=a ; end else begin e:=a; end;end;
if a=d then
begin
b:= a-1;
end else
writeln(e:7);
end; readln end.


yang menentukan bilangan prima dari 2 sampai ke angka yang diinputkan ???
maklum newbie banget di delphi nech...
 
 View user's profile Send private message Yahoo Messenger  
Reply with quote Back to top
ImanD
Post subject:   PostPosted: 18-01-2008 13:43
onElite


Joined: 09-10-2005 13:31
Posts: 1103

aku ga ngerti maksudnya!xixixiix
klo u/ mencari bilangan prima source(pascal) diatas dah bener hasilnya! cobain pke delphi console az!
nah tinggal di renov az listingnya sesuai keinginan!

_________________

website: http://darusmanaiman.net/
e-mail:
darusmanaiman@programmer.net
programmer@darusmanaiman.net
 
 View user's profile Send private message  
Reply with quote Back to top
betamax
Post subject:   PostPosted: 18-01-2008 16:30
onKnowledgeable


Joined: 17-05-2007 02:07
Posts: 233

@Curutz

iyo ik.. dah bener kok pascalnya. tuh. trus mo di ginamain ?
pascal di terjemahin ke delphi ..?
gitu ?

_________________
-|[ H-412-RY]|-
 
 View user's profile Send private message  
Reply with quote Back to top
yusdi
Post subject:   PostPosted: 19-01-2008 10:38
onUber-Skilled


Joined: 26-12-2007 11:44
Posts: 258

rasanya Curutz pake delphi tapi yg console itu ya....(jadi mengingat kenangan lama semester 1)
diajarinnya pake console di delphi,,,eh trus ketagihan pake application di delphi...

_________________
CMIIW

...Regards...
----------------------------------------------------
----------------------------------------------------
x_pLoIT#031
 
 View user's profile Send private message  
Reply with quote Back to top
CurutZOffline
Post subject:   PostPosted: 19-01-2008 14:07
onNovice


Joined: 06-11-2006 09:02
Posts: 13

Status: Offline
iya, maksudnya mau cari source bilangan prima , kalo yang console buat contoh aja....
rencananya buat pake form application, gak console...
teknisnya kurang lebih
1. 2edit yang gunanya untuk ngecek bilangan prima (ini source code yang saya tanyain)
kemaren contoh yang pake console hanya pengurutan bilangan aja, dari 2 sampai yang diinputkan, bukan untuk ngecek bilangan yang diinputkan termasuk prima atau bukan ???
2. bilangan relatif prima (ada contohnya gak) ???????and seperti apa sech relatif prima ???
 
 View user's profile Send private message Yahoo Messenger  
Reply with quote Back to top
yusdi
Post subject:   PostPosted: 19-01-2008 22:12
onUber-Skilled


Joined: 26-12-2007 11:44
Posts: 258

kalo source diatas kan udah bener..jadi tinggal cara input outputnya aja yg diganti.

disesuaikan,bisa dengan Tedit,Tlabel,dkk.....

_________________
CMIIW

...Regards...
----------------------------------------------------
----------------------------------------------------
x_pLoIT#031
 
 View user's profile Send private message  
Reply with quote Back to top
_lmzOffline
Post subject:   PostPosted: 19-01-2008 23:59
onUber-Skilled


Joined: 14-07-2006 23:46
Posts: 417

Status: Offline
CurutZ wrote:
maaf jika udah ada yang seperti ini
help me dunkzzzz......
ada dapat tugas nech.........
disuruh buat tugas rsa mulai dari
a pembangkitan prima p dan q
b mencari prima relatif

ada gak source buat prima ??
coz waktu download hanya

Code:
Program Bilangan_Prima;
...
end.


yang menentukan bilangan prima dari 2 sampai ke angka yang diinputkan ???
maklum newbie banget di delphi nech...


Itu adalah cara yang benar (dan sederhana) tapi bilangan prima yang digunakan di RSA biasanya adalah besar dan akan memakan waktu lama untuk menguji prima/tidaknya dengan cara itu. Cara yang digunakan adalah mencari bilangan random kemudian melakukan test probabilistik atas ke-prima-an bilangan tersebut.

Dari http://www.di-mgt.com.au/rsa_alg.html terdapat cara berikut:

Quote:

To generate the primes p and q, generate a random number of bit length b/2 where b is the required bit length of n; set the low bit (this ensures the number is odd) and set the two highest bits (this ensures that the high bit of n is also set); check if prime (use the Rabin-Miller test); if not, increment the number by two and check again. This is p. Repeat for q starting with an integer of length b-b/2. If p<q, swop p and q (this only matters if you intend using the CRT form of the private key). In the extremely unlikely event that p = q, check your random number generator. For greater security, instead of incrementing by 2, generate another random number each time.


Berikut ada implementasi algoritma miller-rabin: http://krenzel.info/?p=83 (tapi bukan dalam delphi).

Biasanya juga untuk menangani bilangan besar seperti ini maka digunakan library khusus karena angkanya tidak muat di dalam integer biasa. Ada contoh library seperti ini (meskipun tidak khusus untuk RSA tapi cukuplah untuk tugas kuliah) di http://www.delphiforfun.org/Programs/Li ... tegers.htm ... di sana dalam unit UBigIntsV2 ada method seperti ini:

Code:

function Tinteger.IsProbablyPrime: boolean;
  //miller rabin probabilistic primetest with 10 random bases;


Mungkin berguna untuk anda...

Bilangan relatif prima : http://mathworld.wolfram.com/RelativelyPrime.html

"Two integers are relatively prime if they share no common positive factors" ... Berarti p dan q adalah relatif prima apabila gcd(p,q) = 1. Dimana gcd adalah greatest common divisor (kalau gak salah di sini namanya FPB).

Fungsi gcd ini juga ada di unit bigint yang tadi itu.

_________________
Heck, I'll believe anything they want!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 5 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits