Namespaces
Efficient implementation of arrays containing numeric and string values.
Set of functions for checking whether given string falls into
certain character class. These checks are locale-specific.
Frequently used
network communications utilities, such as
reading and writing files using ftp and http,
sending e-mail, etc.
Supported data types:
- string - text in one string
- lines - text in an array of strings
- binary - byte array
- data - any serialized Anvil data structure
The url strings in this module can be any of the following (for example)
- file (
/tmp/a.txt)
- http (
http://njet.net/)
- public ftp (
ftp://ftp.njet.net/pub/x.gif)
- password protected ftp (
ftp://frank:xxx@weather.com/a.dat)
| Author |
Jaripekka Salminen |
Digest and MAC codes, encryption.
Digest and MAC codes
Anvil crypto library can create message hash codes or checksums from any
data. Such codes are useful, for example, in payment applications,
where the checksum verifies that data has not been changed. Also the
hash codes taken from file contents are useful for checking if the
file content is changed or not.
-
Message Digest provides applications the functionality of
a message digest algorithm, such as MD5 or SHA. Message
digests are secure one-way hash functions that take arbitrary-sized
data and output a fixed-length hash value.
-
Message Authentication Code (MAC)
Since everyone can generate the message digest,
it may not be suitable for some security related
applications. Because of this, Anvil also
supports HMAC (rfc2104), which is a mechanism for
message authentication using a (secret) key.
So you can use a key with a hash algorithm to
produce hashes that can only be verified using the same key.
Example. Compute the MD5 digest and hmac and print them out as hex.
key = "Jefe";
data = "what do ya want for nothing?";
digest = crypto.MD5().update(data).final().toHex();
hmac = crypto.MD5(key).update(data).final().toHex();
print "The digest is "+digest;
print "The hmac is "+hmac;
This will produce:
The digest is d03cb659cbf9192dcd066272249f8412
The hmac is 750c783e6ab0b503eaa86e310a5db738
Encryption
Anvil crypto library can also encrypt and decrypt data using DES, TripleDes and
Blowfish algorithms.
Example. Encrypt and decrypt a data string using DES.
key = "Jefe1234";
data1 = "what do ya want ";
data2 = "for nothing?";
cipher = crypto.encrypt(crypto.DES, key);
crypted = cipher.update(data1);
crypted = crypted.concat(cipher.update(data2));
crypted = crypted.concat(cipher.final());
recovered = crypto.decrypt(crypto.DES, key).final(crypted);
| Author |
Jaripekka Salminen |
Provides for system input and output through data streams,
serialization and the file system.
Set of elementary functions and classes.
Entities at anvil.lang are accessible directly without a need
to import or use anvil.lang prefix.
Standard set of mathematical operations.
Provides the functions and classes and for accessing naming services.
Provides access to network services.
Provides access to runtime related operations, such as
output redirection and type inspection.
Provides access to relation databases through the JDBC interface.
Provides access to system related operations,
such as server's resources and configuration.
Timestamps and calendar.
Operations for parsing and inspecting XML documents.