r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Maxim
30-Aug-2010
[18083]
i usually use a random string generated on app startup, the time 
and a random value at each call.  

purists will tell you not to use the system time for the random seed 
.  it creates a time frame of attack which vastly reduces the number 
of hits required for brute force attacks.  


use two independent system data values like disk free size, & a measured 
I/O divided by each other.   a single digit off generates a completely 
different seed, so its much better and cannot be guestimaged easily 
by the attacker.
Graham
30-Aug-2010
[18084]
I just ask the user to think of a number
Gabriele
31-Aug-2010
[18085x2]
This is what I often use:

>> random/seed now
>> enbase checksum/secure random mold system/error     
== "EZHHHYzUpj78+Eab+Y8vygt75ZA="
Of course, if you are running on a real operating system, you can 
get better "randomness" using:

>> p: open/binary/direct %/dev/urandom
>> enbase copy/part p 16
== "2Fm5zVhMBCgQkdQ3afEpYw=="
>> enbase copy/part p 32
== "Ymk3t6HyAgKNzpALcvGSXyV6poSDwRzk5pCR7IoDz68="
>> close p
caelum
3-Sep-2010
[18087]
I'm a newbie to Rebol. I need to know how to delete a file on my 
website. I tried uploading a file using:

write ftp://user:[pass-:-website-:-com]/myfile.enc myfile.enc


which does not work because of the ['-:-'] in the user name. I tried 
replacing the ['-:-'] with '%40', still did not work. So I tried the 
following which works:

ftp-port: [
	scheme: 'ftp
	host: "ftp.mysite.org"
	port-id: 21
	user: "[user-:-mysite-:-org]"
	pass: "xxxxxxxxxxxxx"
	target: %myfile.enc
]
file: read %myfile.enc
write/binary ftp-port file


So now my file is on my server. My question is - How do I delete 
this file? I see no way to tell the Delete command the name of the 
file on my server so it can delete it. And:

delete ftp://user:[pass-:-website-:-com]/myfile.enc


does not work for the same reason the standard velsion of write does 
not work, because of the ['-:-'] in the user name. Any help much appreciated.
Graham
3-Sep-2010
[18088x2]
delete [
	scheme: 'ftp
	host: "ftp.mysite.org"
	port-id: 21
	user: "[user-:-mysite-:-org]"
	pass: "xxxxxxxxxxxxx"
	target: %myfile.enc
]

does that work?
No, delete does not take a file spec
caelum
3-Sep-2010
[18090]
I just found that out.
Graham
3-Sep-2010
[18091x2]
Try this http://rebol.wik.is/Protocols/Ftp

See the file attached at the bottom

do %prot-ftp.r

then, do this

delete ftp://user%2540mysite.org:[pass-:-ftp-:-mysite-:-org]/myfile.enc
Hold the guimauve
caelum
3-Sep-2010
[18093]
I had to type that all out very slowly and carefully, long password, 
and I don't use the shell much these days (I'm an old Amigan). YES 
it worked! Thanks Graham. I'll add the guimauve, they do look delicious. 
Help me out much more and end up delivering a feast.


So I imagine I need to include prot-ftp.r in my Rebol programs and 
I'll be able to use the standard way of accessing files on my server? 
Am I right?

Thanks for all the help, this will get me going now.
Graham
3-Sep-2010
[18094]
I had an Amiga 1000 bought in 1985 ... always used the shell there 
:)
caelum
3-Sep-2010
[18095]
Yep, those were the days :) My Amiga 4000 finally died in 2002. That's 
when I switched to linux. No more Amiga :(
Graham
3-Sep-2010
[18096x2]
You can try this .... instead of loading up the ftp protocol, 


 system/schemes/ftp/handler/open-check: [none ["220" "230"] ["USER" 
 dehex port/user] "331" ["PASS" port/pass] "230" "SYST" "*"]
ie. patch the scheme in memory
caelum
3-Sep-2010
[18098]
Patch the scheme in memory, OK I'll give that a go. I'm on a steep 
learning curve here.
Graham
3-Sep-2010
[18099]
In REBOL, all code is just data ...
caelum
3-Sep-2010
[18100x4]
But I'm getting the idea.
'All code is just data'. That's what I like about Rebol.
system/schemes/ftp/handler/open-ftp - Is that on windows? I don't 
have anything like that here on linux.
Just found it. It's in /home/user/Rebol/source.
Graham
3-Sep-2010
[18104x3]
eh??
system is a REBOL object
it's open-check .. not open-ftp
Henrik
3-Sep-2010
[18107]
? system/schemes/ftp/handler

will show you what resides inside the handler
caelum
3-Sep-2010
[18108x4]
Sorry, my typing error. I found open-check in /home/user/Rebol/source/prot-ftp.r 
and changed it to your code above, and it works! I have Rebol in 
my home folder, not in any of the linux (Ubuntu) system folders.
prot-ftp.r is a file in my home folder. I hope that makes sense. 
Anyway, your code works :)
I have the sdk!
With a license.
Graham
3-Sep-2010
[18112]
sure .. you can patch it so that you just encap it later on
caelum
3-Sep-2010
[18113]
Sadly, I have yet to get encap to work on linux (Ubuntu). I'll figure 
that one out later. For now my goal is to just get everything working. 
I'll not be passing out programs for others to use for another few 
months. That's when I'll need encap.
Henrik
3-Sep-2010
[18114]
Hopefully you have a Linux SDK license?
caelum
3-Sep-2010
[18115x2]
I do, and a windows one.
You can tell I'm serious about switching to Rebol.
Henrik
3-Sep-2010
[18117]
yes, that's always good :-)
Graham
3-Sep-2010
[18118]
http://www.rebol.net/cgi-bin/rambo.r?id=-4777&

Delete does not take a port spec

( Gabriele are you still reviewing Rambo submissions? )
Gabriele
3-Sep-2010
[18119]
I think that can be worked around by using REMOVE on the port opened 
on the directory that contains the file... worth testing maybe.

Anyway, yes. Ticket is now #4401.
Graham
3-Sep-2010
[18120]
Would this stop rebol working ? http://downloads.zdnet.com/abstract.aspx?docid=2111429&tag=nl.e530
Maxim
4-Sep-2010
[18121]
i don't think so.
Graham
13-Sep-2010
[18122x2]
Henrik, what's this bug regarding 'encloak that you have mentioned 
on your blog?
encloak uses SHA1 I think
Henrik
13-Sep-2010
[18124]
Graham, link? I can't remember that blog entry.
Graham
13-Sep-2010
[18125x3]
This is BSD C code for SHA 224 - 512 ... can someone review this 
to see if we can include in 2.7.8 ?
http://www.hmkdesign.dk/rebol/files/category-rebol-3.html
http://www.ouah.org/ogay/sha2/
Henrik
13-Sep-2010
[18128]
I can't remember what the bug was. It may have been fixed in the 
meantime.
Graham
13-Sep-2010
[18129x2]
I looked on rambo and saw no entries for encloak
35kb of C source
Henrik
13-Sep-2010
[18131]
I think the issue was around R3's encloak, not R2.
Graham
13-Sep-2010
[18132]
oh .ok