ここにスクリプトを公開します この暗号にはキーコードによって暗号化のスピードが違ったり、 暗号化された文章に癖が出たりという弱点があります。 もしよろしければ物好きの方で物足りないがこのレベルの簡単な暗号でもいいという方は 自由に改良してください。改良によって拙作が良くなれば私としても光栄です。 ****************************************************************************************** #include "hsptv.as" title"暗号" *home cls screen a="" pos 20,60 a=str(a) mesbox a,200,180,1,150 dim v,4 v.0=1 repeat redraw 2 color 0,0,0 boxf color 255,255,225 font "",15 pos 300,10 mes "KEY CODE 1(3桁の数字)を設定してください\nKEY CODE 2(1桁の数字)を設定してください\n英文のみの対応です" pos 0,0 mes"KEY CODE 1" pos 90,0 mes"KEY CODE 2" pos 0,17 ;x font "",30,1 mes ""+v.0+" "+v.1+" "+v.2+"" pos 110,17 mes ""+y+"";y pos 20,245 mes" 暗号化" pos 20,290 color 215,255,255 mes" 復号" pos 20,340 color 225,235,215 mes" 交流" onclick gosub*atari redraw 1 bmpsave"as.bmp" wait 1 loop stop *atari if (mousex>0)and(mousex<17)and(mousey>17)and(mousey<47):v.0+1 if (mousex>17)and(mousex<36)and(mousey>17)and(mousey<47):v.1+1 if (mousex>40)and(mousex<60)and(mousey>17)and(mousey<47):v.2+1 if (mousex>105)and(mousex<125)and(mousey>17)and(mousey<47):y+1 if (mousex>20)and(mousex<90)and(mousey>245)and(mousey<285):goto,*encode if (mousex>20)and(mousex<90)and(mousey>290)and(mousey<330):goto,*discode if (mousex>20)and(mousex<90)and(mousey>340)and(mousey<370):goto,*interact if v.0>9:v.0=1 if v.1>9:v.1=0 if v.2>9:v.2=0 if y>9:y=0 return *encode onclick 1 q=str(v.0) p=str(v.1) r=str(v.2) s="" s=q+p+r x=int(s) k=str(k) k="" f=str(f) f="" repeat strlen(a) w=cnt gosub*key b=strmid(a,cnt,1) cnvstow c,b e=c+(x+z) repeat if (e<127):break if e>127:e-127 loop d=cnvwtos(e) f+d b=strmid(f,cnt,1) cnvstow c,b e=c-(x+z) repeat if e>0:break if e<=0:e+127 loop d=cnvwtos(e) k+d loop cls 4 color 205,208,230 mes" 暗号文" mesbox f,240,300,0,150 pos 340,0 mes" 元の文章" mesbox k,240,300,0,150 pos 260,20 button"戻る",*home stop *discode onclick 1 q=str(v.0) p=str(v.1) r=str(v.2) s="" s=q+p+r x=int(s) f="" repeat strlen(a) w=cnt gosub*key b=strmid(a,cnt,1) cnvstow c,b e=c-(x+z) repeat if (e>0):break if e<=0:e+127 loop d=cnvwtos(e) f+d loop cls 4 color 120,255,245 mes" 復号結果" mesbox f,240,230,0,150 pos 20,270 button"戻る",*home stop *key if y=0:z=w+2 if y=1:z=w if y=2:z=w*2 if y=3:z=(w+4)/3 if y=4:z=(w+3)/2 if y=5:z=w+1 if y=6:z=(w+6)/3 if y=7:z=w+7 if y=8:z=w+127 if y=9:z=w/2 return *interact comm="" cls 4 color 245,231,222 hsptv_up -1,"", if a="私は管理者です。データをresetしに参りました":hsptv_up score,"",4096+8192;scoreをゼロにする gosub *update pos 500,32:objsize 120,24 mes "コメント" mesbox comm,100,42,1,64 button "送信",*send button"戻る",*home stop *send hsptv_getrank rscor,ruser,rcomm,0 score=rscor+1 hsptv_up score,""+comm+"" goto,*interact *update sdim rcomm,30 color 255,255,234 repeat 30 hsptv_getrank rscor,ruser,rcomm,cnt if ss>7:ax+125:ay=0:ss=0 ss+1 pos ax,ay mes ""+ruser+"" ay+59 mesbox rcomm,120,42,0,64 loop ax=0:ay=0:ss=0 return ver 1.02 #include "hsptv.as" title"暗号" *home commx="" cls screen a="" pos 20,60 a=str(a) mesbox a,200,180,1,150 dim v,4 v.0=1 repeat redraw 2 color 0,0,0 boxf color 255,255,225 font "",15 pos 300,10 mes "KEY CODE 1(3桁の数字)を設定してください\nKEY CODE 2(1桁の数字)を設定してください\n英文のみの対応です" pos 0,0 mes"KEY CODE 1" pos 90,0 mes"KEY CODE 2" pos 0,17 ;x font "",30,1 mes ""+v.0+" "+v.1+" "+v.2+"" pos 110,17 mes ""+y+"";y pos 20,245 mes" 暗号化" pos 20,290 color 215,255,255 mes" 復号" pos 20,340 color 225,235,215 mes" 交流" onclick gosub*atari redraw 1 bmpsave"as.bmp" wait 1 loop stop *atari if (mousex>0)and(mousex<17)and(mousey>17)and(mousey<47):v.0+1 if (mousex>17)and(mousex<36)and(mousey>17)and(mousey<47):v.1+1 if (mousex>40)and(mousex<60)and(mousey>17)and(mousey<47):v.2+1 if (mousex>105)and(mousex<125)and(mousey>17)and(mousey<47):y+1 if (mousex>20)and(mousex<90)and(mousey>245)and(mousey<285):goto,*encode if (mousex>20)and(mousex<90)and(mousey>290)and(mousey<330):goto,*discode if (mousex>20)and(mousex<90)and(mousey>340)and(mousey<370):goto,*interact if v.0>9:v.0=1 if v.1>9:v.1=0 if v.2>9:v.2=0 if y>9:y=0 return *encode onclick 1 q=str(v.0) p=str(v.1) r=str(v.2) s="" s=q+p+r x=int(s) k=str(k) k="" f=str(f) f="" repeat strlen(a) w=cnt gosub*key b=strmid(a,cnt,1) cnvstow c,b e=c+(x+z) repeat if (e<127):break if e>127:e-127 loop d=cnvwtos(e) f+d b=strmid(f,cnt,1) cnvstow c,b e=c-(x+z) repeat if e>0:break if e<=0:e+127 loop d=cnvwtos(e) k+d loop cls 4 color 205,208,230 mes" 暗号文" mesbox f,240,300,0,150 objsize 140,40 button"暗号文を交流に書き込む",*interact2 objsize 60,25 pos 340,0 mes" 元の文章" mesbox k,240,300,0,150 pos 260,20 button"戻る",*home stop *discode onclick 1 q=str(v.0) p=str(v.1) r=str(v.2) s="" s=q+p+r x=int(s) f="" repeat strlen(a) w=cnt gosub*key b=strmid(a,cnt,1) cnvstow c,b e=c-(x+z) repeat if (e>0):break if e<=0:e+127 loop d=cnvwtos(e) f+d loop cls 4 color 120,255,245 mes" 復号結果" mesbox f,240,230,0,150 pos 20,270 button"戻る",*home stop *key if y=0:z=w+2 if y=1:z=w if y=2:z=w*2 if y=3:z=(w+4)/3 if y=4:z=(w+3)/2 if y=5:z=w+1 if y=6:z=(w+6)/3 if y=7:z=w+7 if y=8:z=w+127 if y=9:z=w/2 return *interact2 commx="" commx=f *interact comm="" comm=commx cls 4 color 245,231,222 hsptv_up -1,"", if a="私は管理者です。データをresetしに参りました":hsptv_up score,"",4096+8192;scoreをゼロにする gosub *update pos 500,32:objsize 120,24 mes "コメント" mesbox comm,100,42,1 button "送信",*send button"戻る",*home button gosub"次へ",*update2 stop *send hsptv_getrank rscor,ruser,rcomm,0 score=rscor+1 hsptv_up score,""+comm+"" goto,*interact *update2 nextn+15 if nextn=30:nextn=0 color 0,0,0 boxf *update sdim rcomm,30 color 255,255 pos 0,0 mes ""+f+","+commx+","+comm+"" mes"重要:ENTERでの改行はお止め下さい:不都合が起きます" color 255,255,234 repeat 15 hsptv_getrank rscor,ruser,rcomm,cnt+nextn if ss>4:ax+135:ay=0:ss=0 ss+1 pos ax+35,ay+20 mes"{"+rscor+"}" mesbox ruser,120,20,0 ay+80 mesbox rcomm,120,42,0 loop ax=0:ay=0:ss=0 return