Sponsored Content
Top Forums Shell Programming and Scripting Generate random numbers in script Post 302781737 by SkySmart on Sunday 17th of March 2013 03:27:40 PM
Old 03-17-2013
Quote:
Originally Posted by Corona688
You've been down this road many times before.

Your script, by definition, would include the complete and unabridged method for generating this "secret" number. How would you conceal it? If the computer can decode it, so can they, no ifs or buts. You're not going to defeat this by being clever enough, the same way you can't change the value of pi by being clever enough.

The kind of security you want can be achieved by not letting their computer read it.
i understand what you're saying. but there's been quite a few things that i've read couldn't be done, but ended up being doable. they just required "being clever" enough, and having the excessive dedication time it takes to actually write something noone in their right mind would want to try to break unless given a massive monetary incentive to do so. and even then, you'd have to be in the mind of the coder to know what he's doing, especially if the script or code is large in size, void of comments, and not written in a way that makes it easily comprehended. but thanks for your input. much appreciated.
 

10 More Discussions You Might Find Interesting

1. Programming

How to generate a random number?

How to generate a random integer with specific range(for example, from 1 to 1000)? Also, how to convert a floating point number into a integer? (2 Replies)
Discussion started by: MacMonster
2 Replies

2. Shell Programming and Scripting

Generate a random password

Hello All... Can someone help me generate a random password which will be 7 characters long which contains alpha-numeric characters using shell script. I am looking to store the output of the script that generates the password to a variable within a script and use it as the password. ... (5 Replies)
Discussion started by: chiru_h
5 Replies

3. Shell Programming and Scripting

how do i generate random integer using only shell script

Hi All, I need to generate 4 digit random no using only shell script. Please help in this ASAP. Thanks in advance... Regards, sridhar. (1 Reply)
Discussion started by: sridhusha
1 Replies

4. Shell Programming and Scripting

shell script to auto process ten random files and generate logs

Hello member's I'm learning to script in the ksh environment on a Solaris Box. I have 10 files in a directory that I need to pass, as input to a batch job one by one. lets say, the files are named as follows: abcd.txt ; efgh.bat ; wxyz.temp etc. (random filenames with varied extensions ).... (1 Reply)
Discussion started by: novice82
1 Replies

5. Programming

Generate random number

I saw this formula to generate random number between two specified values in shell script.the following. $(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)) Give a example in book. Generate random number between 6 and 30.like this. $(((RANDOM%30/3+1)*3)) But I have a... (1 Reply)
Discussion started by: luoluo
1 Replies

6. Programming

generate array of random numbers

hi guys, I am writing a c program that generates a two dimensional array to make matrix and a vector of random numbers and perform multiplication. I can't figure out whats wrong with my code. It generates a matrix of random numbers but all the numbers in the vector array is same and so is the... (2 Replies)
Discussion started by: saboture88
2 Replies

7. Shell Programming and Scripting

Generate 16 digit positive random Numbers

Hi Unix Gurus, I have a requirement to generate positive random 16 and 13 digit numbers. Here is the script I have so far..... number=$RANDOM$RANDOM$RANDOM$RANDOM; let "number %= 10000000000000"; echo $number But sometimes it is generating negative numbers and also 15 digit... (8 Replies)
Discussion started by: scorpioraghu
8 Replies

8. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies

9. UNIX for Advanced & Expert Users

UNIX script for making random numbers without repetition

Hello, I have a column which have 7200 numbers and I am deciding to pick up 1440 numbers randomly without any reputation? Could any one let me know which script in unix will be work for my case? Regards Sajjad (17 Replies)
Discussion started by: sajmar
17 Replies

10. Shell Programming and Scripting

Script to generate sequence of numbers

I need awk script to generate part number sequencing based on data in multiple columns like below Input File --------- Col A|Col B|Col C| 1|a|x| 2|b|y| |c|z| | |m| | |n| And out put should be like 1ax 1ay 1az 1am 1an 1bx 1by (6 Replies)
Discussion started by: aramacha
6 Replies
Frontier::RPC2(3pm)					User Contributed Perl Documentation				       Frontier::RPC2(3pm)

NAME
Frontier::RPC2 - encode/decode RPC2 format XML SYNOPSIS
use Frontier::RPC2; $coder = Frontier::RPC2->new; $xml_string = $coder->encode_call($method, @args); $xml_string = $coder->encode_response($result); $xml_string = $coder->encode_fault($code, $message); $call = $coder->decode($xml_string); $response_xml = $coder->serve($request_xml, $methods); $boolean_object = $coder->boolean($boolean); $date_time_object = $coder->date_time($date_time); $base64_object = $coder->base64($base64); $int_object = $coder->int(42); $float_object = $coder->float(3.14159); $string_object = $coder->string("Foo"); DESCRIPTION
Frontier::RPC2 encodes and decodes XML RPC calls. $coder = Frontier::RPC2->new( OPTIONS ) Create a new encoder/decoder. The following option is supported: encoding The XML encoding to be specified in the XML declaration of encoded RPC requests or responses. Decoded results may have a different encoding specified; XML::Parser will convert decoded data to UTF-8. The default encoding is none, which uses XML 1.0's default of UTF-8. For example: $server = Frontier::RPC2->new( 'encoding' => 'ISO-8859-1' ); use_objects If set to a non-zero value will convert incoming <i4>, <float>, and <string> values to objects instead of scalars. See int(), float(), and string() below for more details. $xml_string = $coder->encode_call($method, @args) `"encode_call"' converts a method name and it's arguments into an RPC2 `"methodCall"' element, returning the XML fragment. $xml_string = $coder->encode_response($result) `"encode_response"' converts the return value of a procedure into an RPC2 `"methodResponse"' element containing the result, returning the XML fragment. $xml_string = $coder->encode_fault($code, $message) `"encode_fault"' converts a fault code and message into an RPC2 `"methodResponse"' element containing a `"fault"' element, returning the XML fragment. $call = $coder->decode($xml_string) `"decode"' converts an XML string containing an RPC2 `"methodCall"' or `"methodResponse"' element into a hash containing three members, `"type"', `"value"', and `"method_name"'. `"type"' is one of `"call"', `"response"', or `"fault"'. `"value"' is array containing the parameters or result of the RPC. For a `"call"' type, `"value"' contains call's parameters and `"method_name"' contains the method being called. For a `"response"' type, the `"value"' array contains call's result. For a `"fault"' type, the `"value"' array contains a hash with the two members `"faultCode"' and `"faultMessage"'. $response_xml = $coder->serve($request_xml, $methods) `"serve"' decodes `$request_xml', looks up the called method name in the `$methods' hash and calls it, and then encodes and returns the response as XML. $boolean_object = $coder->boolean($boolean); $date_time_object = $coder->date_time($date_time); $base64_object = $coder->base64($base64); These methods create and return XML-RPC-specific datatypes that can be passed to the encoder. The decoder may also return these datatypes. The corresponding package names (for use with `"ref()"', for example) are `"Frontier::RPC2::Boolean"', `"Frontier::RPC2::DateTime::ISO8601"', and `"Frontier::RPC2::Base64"'. You can change and retrieve the value of boolean, date/time, and base64 data using the `"value"' method of those objects, i.e.: $boolean = $boolean_object->value; $boolean_object->value(1); Note: `"base64()"' does not encode or decode base64 data for you, you must use MIME::Base64 or similar module for that. $int_object = $coder->int(42); $float_object = $coder->float(3.14159); $string_object = $coder->string("Foo"); By default, you may pass ordinary Perl values (scalars) to be encoded. RPC2 automatically converts them to XML-RPC types if they look like an integer, float, or as a string. This assumption causes problems when you want to pass a string that looks like "0096", RPC2 will convert that to an <i4> because it looks like an integer. With these methods, you could now create a string object like this: $part_num = $coder->string("0096"); and be confident that it will be passed as an XML-RPC string. You can change and retrieve values from objects using value() as described above. SEE ALSO
perl(1), Frontier::Daemon(3), Frontier::Client(3) <http://www.scripting.com/frontier5/xml/code/rpc.html> AUTHOR
Ken MacLeod <ken@bitsko.slc.ut.us> perl v5.10.1 2011-04-05 Frontier::RPC2(3pm)
All times are GMT -4. The time now is 05:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy