Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - nslay

Pages: 1 2 [3] 4 5
31
General Discussion / Theoretically longest sentence
« on: January 21, 2011, 10:58:08 am »
Sentences must be finite in length. You can only cram so many verbs, adjectives, nouns, adverbs, etc... into a sentence until you violate some grammar rules. So how would one go about computing the theoretically longest sentence possible? Let's suppose two measures of length: the string length and the word count.

To make it easier, let's first suppose the sentence doesn't necessarily need to make sense.

I don't think a mathematical description of comprehension exists yet. I don't think we could solve this over the set of sentences that make sense.

EDIT: Ok, so a trivial solution is to suppose a sentence that lists nouns indefinitely. Let's find a non-trivial solution.

32
General Discussion / Arguments against Net Neutrality?
« on: December 28, 2010, 03:30:45 am »
Can someone explain to me the arguments against net neutrality?

I haven't heard a single argument from opponents that makes any sense! The people who oppose net neutrality seem to be technically illiterate.  When opposing politicians and biased news anchors talk, I hear technical terms incoherently strung together with no basis or meaning!

One good argument I heard against FCC passing net neutrality rules was that FCC doesn't/shouldn't have that kind of power and that net neutrality should be passed into law by the legislative branch of the government.  However, this isn't directly related to net neutrality itself.

What I find so incredibly odd is that a lot of free market advocates oppose net neutrality. Is it me, or are they contradicting themselves?  Allowing network operators to discriminate communication could potentially hinder competition in a variety of ways.  Isn't that bad if you're a free market advocate?  Talk about duh!

As for net neutrality advocates ... I almost feel like they're just as stupid!  Look at the SaveTheInternet website.  Play the flash video: Real vs Fake Net Neutrality.  I'm not sure what to take away from that presentation ... I'm not even sure what the purported fake net neutrality rules are or what makes them fake!

Look at this letter-to-congressman template:
Quote
Dear Member of Congress [cc: FCC]
Net Neutrality is the cornerstone of innovation, free speech and democracy on the Internet.

More than 1.9 million Americans have expressed support for Net Neutrality at Congress and the FCC. They want control over the Internet to remain in the hands of the people who use it every day.

Please stand with the public by protecting Net Neutrality once and for all.
(URL: http://act2.freepress.net/letter/two_million/)

Two million people have mailed TOILET PAPER to their representatives.  This isn't a good, well thought out reason to support net neutrality!  Where's the compelling argument for healthy competition? The government doesn't give a fuck about the innovation, free speech and democracy on the Internet (What ever that means!).

I am very afraid for the Internet!  We have complete morons arguing on both sides!  It's like two headless chickens duking it out!

34
General Discussion / Who is attacking?
« on: December 08, 2010, 01:34:58 am »
The news keeps mentioning DDoS attacks against wikileaks and I've read that there are attacks against PayPal now ...
Has anybody taken the time to figure out who?  Who is orchestrating these attacks from both sides?  Isn't anybody else curious? 

Screw the documents, I'm curious about the attackers.  This isn't your typical anti-Microsoft or anti-copyright case ... this is some political crap.  Who in the heck pulls off attacks like this for crap like that?

35
General Discussion / Facebook Security Breach
« on: October 18, 2010, 09:20:22 am »
I saw this on CNN today.  The expert they interviewed on CNN brought up a lot of the points I bring up (even Google was mentioned).

Now to read the article! :D

36
General Discussion / Google: What did I say all along?
« on: September 30, 2010, 01:04:07 am »
I came across this on freebsd-chat mailing list:
http://online.wsj.com/article/SB126333757451026659.html

Quote
Google said it suffered a "highly sophisticated and targeted attack on our corporate infrastructure originating from China" in mid-December, which it said resulted in "the theft of intellectual property." The company said it found evidence to suggest that a primary goal of the attackers was accessing the Gmail accounts of Chinese human-rights activists.

Gosh! I remember suggesting that one of the consequences of the Chinese hacking Google was that it could identify it's own citizens abroad viewing or propagating otherwise censored material!  Who knows what else the hackers had access to ...

It's not Google ... it's the fact that it collects and stores so much information about EVERYTHING

What's next? Facebook supplanting government issued ID (:D)?  These technological trends are shortchanging everyone ... but nobody can see that over all the free cool toys ... with the concealed price tag of your soul.


37
Academic / School / Break this cipher! (math)
« on: August 26, 2010, 01:46:00 pm »
NOTE: \mathbf{} is broken ... I made vectors bold but they do not appear so.

I wandered into this cipher idea accidentally last night.  This cipher is very simple, but it does not appear trivial to break.
First off, the cipher operation is a linear transformation of the form

[latex]
\mathbf{c} = M \mathbf{x}
[/latex]

where [latex]\mathbf{c} \in \mathbb{R}^n[/latex] is the cipher text, [latex]\mathbf{x} \in \mathbb{R}^n[/latex] is the input block of data and [latex]M \in \mathbb{R}^{n \times n}[/latex] of the form

[latex]
M = PZR
[/latex]

Here [latex]P,R[/latex] are randomly generated invertible [latex]n \times n[/latex] matrices and [latex]Z[/latex] is an [latex]n \times n[/latex] singular matrix of the form

[latex]
Z = n I - \mathbf{1} \mathbf{1}^T \quad \text{where } \mathbf{1} = \begin{bmatrix}
1 \\
1 \\
\vdots \\
1 \\
\end{bmatrix}
[/latex]

(Sorry, [latex]\mathbf{1}[/latex] vector should be bold)

As a consequence, the matrix [latex]M[/latex] is also singular and the factorization is not unique (beyond mere scalar factors!).  However, even though [latex]M[/latex] is not invertible, this linear transformation can still be reversed with additional information.
Denote [latex]\mathbf{v} \in \mathbb{R}^n[/latex] to be the secret key either shared in advance or generated by some key agreement protocol.  Now we require the matrix [latex]R[/latex] to be randomly generated so that [latex]\mathbf{v} = R^T \mathbf{1}[/latex] (again \mathbf{} is broken, [latex]\mathbf{1}[/latex] should be bolded as it is a vector).  In addition to the cipher text [latex]\mathbf{c}[/latex], the value [latex]k = \mathbf{v}^T \mathbf{x}[/latex] is also provided to invert [latex]M[/latex].

The matrix [latex]Z[/latex] has the property that rows and columns sum to [latex]0[/latex].  I call these types of matrices zero sum matrices and they can be used to easily solve problems with summation-based constraints as unconstrained problems (an alternative to Lagrange multipliers for example).  [latex]Z[/latex] projects [latex]\mathbb{R}^n[/latex] into [latex]\{ \mathbf{x}\ :\ \mathbf{1}^T \mathbf{x} = 0,\ \mathbf{x} \in \mathbb{R}^n \}[/latex], the space of vectors whose components sum to [latex]0[/latex].  Any linear transformation with [latex]Z[/latex] discards the summation information of [latex]\mathbf{x}[/latex].  However, if the component sum of [latex]\mathbf{x}[/latex] is known, then this linear transformation can be inverted.  In our particular problem

[latex]
\mathbf{x} = \frac{1}{n} ( Z \mathbf{x} + \mathbf{1} (\mathbf{1}^T \mathbf{x}) )
[/latex]

(Sorry, [latex]\mathbf{1}[/latex] vector should be bold)

So, inverting [latex]M[/latex] works like this:
Given [latex]P,R,\mathbf{c},k[/latex]

1) Solve [latex]P \mathbf{y} = \mathbf{c}[/latex]
2) Compute [latex]\mathbf{z} = \frac{1}{n} ( \mathbf{y} + \mathbf{1} k )[/latex] (Sorry, [latex]\mathbf{1}[/latex] vector should be bold)
3) Solve [latex]R \mathbf{x} = \mathbf{z}[/latex] to recover [latex]\mathbf{x}[/latex]

Here's the crypto scheme:
Bob wants to securely share [latex]\mathbf{x} \in \mathbb{R}^n[/latex] with Alice.  Bob and Alice both have the secret key [latex]\mathbf{v}[/latex].

Alice
Bob
[latex]\mathbf{v}[/latex]
[latex]\mathbf{v},\mathbf{x}[/latex]

1) Alice randomly generates invertible [latex]P,R \in \mathbb{R}^{n \times n}[/latex] so that [latex]\mathbf{v} = R^T \mathbf{1}[/latex] (Sorry, [latex]\mathbf{1}[/latex] vector should be bold) and computes

[latex]
M = PZR
[/latex]

Alice shares [latex]M[/latex] with Bob.

Alice
Bob
[latex]\mathbf{v},P,R,M[/latex]
[latex]\mathbf{v},\mathbf{x},M[/latex]

2) Bob computes [latex]\mathbf{c} = M \mathbf{x}[/latex] and [latex]k = \mathbf{v}^T \mathbf{x}[/latex] and shares [latex]\mathbf{c},k[/latex] with Alice

Alice
Bob
[latex]\mathbf{v},P,R,M,\mathbf{c},k[/latex]
[latex]\mathbf{v},\mathbf{x},M,\mathbf{c},k[/latex]

3) Alice solves

[latex]
P \mathbf{y} = \mathbf{c}
\mathbf{z} = \frac{1}{n} ( \mathbf{y} + \mathbf{1} k )
R \mathbf{x} = \mathbf{z}
[/latex]

(Sorry, [latex]\mathbf{1}[/latex] vector should be bold)

to recover [latex]\mathbf{x}[/latex].

Alice
Bob
[latex]\mathbf{v},P,R,M,\mathbf{c},k,\mathbf{x}[/latex]
[latex]\mathbf{v},\mathbf{x},M,\mathbf{c},k[/latex]

Example Problem:
If you have the time and interest, I'd be curious if any of you could break the following example ciphertext:

[latex]
\mathbf{c} = \begin{bmatrix}
8856 \\
-16178 \\
246 \\
102128 \\
50331 \\
110304 \\
-6464 \\
-71322 \\
-13541 \\
-45762 \\
\end{bmatrix}
[/latex]

[latex]
k = 17409
[/latex]

Given

[latex]
M = \begin{pmatrix}
-156 & 96 & -10 & 34 & 32 & 134 & -162 & 296 & 268 & -138 \\
148 & -178 & -30 & 78 & 224 & -452 & -124 & -38 & -254 & 474 \\
84 & 236 & 0 & -216 & 372 & 194 & 58 & -344 & 428 & 302 \\
572 & 148 & 570 & 42 & 216 & 352 & 94 & 88 & 174 & 156 \\
204 & 6 & 140 & 64 & 127 & 269 & 223 & -79 & 273 & 177 \\
336 & -56 & 440 & 216 & -142 & 496 & 372 & 224 & -178 & 58 \\
-36 & 146 & -30 & 134 & 292 & -206 & 78 & -324 & 408 & -38 \\
-358 & -262 & -290 & -18 & 186 & -318 & -176 & -52 & 164 & 146 \\
6 & 144 & 50 & -154 & 53 & 1 & -143 & -21 & 57 & -117 \\
-58 & -12 & -440 & -68 & -334 & -268 & 34 & -82 & -466 & 86 \\
\end{pmatrix}
[/latex]

Copy and paste for matlab/octave input
Code: [Select]
c = [ 8856 -16178 246 102128 50331 110304 -6464 -71322 -13541 -45762 ]';
k = 17409;
M = [ -156 96 -10 34 32 134 -162 296 268 -138;
148 -178 -30 78 224 -452 -124 -38 -254 474;
84 236 0 -216 372 194 58 -344 428 302;
572 148 570 42 216 352 94 88 174 156;
204 6 140 64 127 269 223 -79 273 177;
336 -56 440 216 -142 496 372 224 -178 58;
-36 146 -30 134 292 -206 78 -324 408 -38;
-358 -262 -290 -18 186 -318 -176 -52 164 146;
6 144 50 -154 53 1 -143 -21 57 -117;
-58 -12 -440 -68 -334 -268 34 -82 -466 86 ];


38
General Discussion / Mini ITX Server
« on: July 25, 2010, 05:18:17 pm »
I recently built a Mini ITX server to replace a larger, more power hungry, desktop server.  This is the setup.  The motherboard is relatively expensive but includes dual RJ45 jacks, 64 bit dual core HT Atom D510, and PCIe.  You can find cheaper boards with dual RJ45 jacks, but with legacy PCI (some with Mini PCIe which is worthless) and x86 VIA processors. I'm hoping to get many years out of this system and I don't want legacy hardware or software interfaces.

This server serves as a Wi-Fi access point, ethernet router, stateful firewall, NFS server, SVN server, SSH server (tunneling), and web server.

The D-Link DWA-556 is one of two PCIe wireless cards that I could find (Neither Netgear nor Linksys produce one).  It's based on the Atheros AR5008 chipset and works swell for hostap in FreeBSD and Linux (as with previous Atheros chipsets).  The other PCIe wireless card is the cheaper Asus PCE-N13 which is based on the Ralink RT2860 chipset and presently only supported by OpenBSD and Linux.  I have no experience with Ralink cards and hostap.  I would only recommend Atheros cards for Wi-Fi access points.

For size comparison, here is a picture of a mid-tower ATX case and a Mini ITX case side-by-side.  Here, the Mini ITX system is being configured to assume it's new role.

NOTE: If you build a Mini ITX system with a slim drive (e.g. like a Laptop DVD drive), be sure to order a Slim SATA cable as slim drives don't use the ordinary SATA cables.  Slim SATA cables combine power and SATA into one.

39
General Discussion / Impact ... *pulls hair out*
« on: June 30, 2010, 06:46:47 pm »
Why do we continue to abuse the word, "impact" when words like "affect" or "influence" are better alternatives!? I mean, turn on any news station and listen to them! Every damn thing is an impact, or something was impacted. I mean, look at these definitions for impact
Quote
–noun
1.
the striking of one thing against another; forceful contact; collision: The impact of the colliding cars broke the windshield.
2.
an impinging: the impact of light on the eye.
3.
influence; effect: the impact of Einstein on modern physics.
4.
an impacting; forcible impinging: the tremendous impact of the shot.
5.
the force exerted by a new idea, concept, technology, or ideology: the impact of the industrial revolution.
–verb (used with object)
(Where the FUCK did this come from?)
6.
to drive or press closely or firmly into something; pack in.
7.
to fill up; congest; throng: A vast crowd impacted St. Peter's Square.
8.
to collide with; strike forcefully: a rocket designed to impact the planet Mars.
9.
to have an impact or effect on; influence; alter: The decision may impact your whole career. The auto industry will be impacted by the new labor agreements.
–verb (used without object)
(Really!? ... "effect", "influence"?)
10.
to have impact or make contact forcefully: The ball impacted against the bat with a loud noise.
11.
to have an impact or effect: Increased demand will impact on sales. (... "effect"?)

I mean, almost EVERY definition has to do with physical collision or contact of some sort ... it's like these other definitions were tacked on!  They're not even similar!

I mean, why would you say,
Quote
How will this impact employers?
instead of
Quote
How will this affect employers?

Or
Quote
What impact will this have on residents?
as opposed to
Quote
What effect will this have on residents?

Or even
Quote
How will this impact immigration laws?
rather than
Quote
How will this influence immigration laws?

How in the heck did we manage to screw up a word like "impact"!?  Every time I watch the news, I feel like an earwig is eating my brain!

40
I used to employ a firewall rule that would detect spurious connects on port 22 (ssh) and place both the offending IP on a badguys table and flush the state table for said IP (Meaning, anything connected with that source IP was no longer treated as connected by the firewall).  A cron job would then cleanup old entries from the badguys table.  For years, this worked remarkably!  My auth log would show 3 attempts and then activity from the source ceased.  Unfortunately, the bot nets got smarter.  I started seeing several hundreds of bots attempting a password every several minutes which isn't spurious.  As a consequence, my auth log would be flooded with annoying password failures!  So, I opted to block everything except address blocks of known locations (e.g. cafe, work, school, etc...) on top of the spurious connect rule.  This works well most of the time but did not fare so well with friends' or acquaintances' houses, airports, or new public WiFi locations in general (which I use my SSH server as a secure tunnel).  As I'm to travel soon, the thought of dynamic DNS came to mind.  Simply keep a list of dynamic domains and have a cron job resolve each one and add it to the goodguys table (and delete the previous resolutions if they differ).  I don't claim it's a new idea, but it's certainly ANOTHER solution.

Too Long Didn't Read
  • Block ALL incoming (at least) SSH connections with your firewall.
  • Add an exception rule for incoming SSH connections for any address on the goodguys table.
  • Make a Dynamic DNS hostname (e.g. no-ip.com) for each trusted mobile computer.
  • Install a Dynamic Update Client on each trusted mobile computer.
  • Add a cron job (every 5 minutes) that resolves a list of dynamic hostnames and adds their corresponding IPs to the goodguys table (preferably deleting old different resolutions).
  • Enjoy boiled peanuts (Very necessary, it won't work otherwise).

Here's an example of a Bourne shell script to do step 5 (for pf(4) on FreeBSD) (an updated version can be found here)
Code: [Select]
#!/bin/sh

GOODGUYS=/root/goodguys.txt
TABLE=goodguys

while read host
do
        hostfile="/tmp/goodguys.${host}"
        oldip=""

        if [ -s "${hostfile}" ]
        then
                read oldip < ${hostfile}
        fi

        str=`host -t A $host 2>/dev/null`
        if [ $? -eq 0 ]
        then
                ip=`echo "${str}" | awk '{ print $NF; exit }'`
                echo "${ip}" > ${hostfile}
        else
                ip=""
                rm -f ${hostfile}
        fi

        if [ -n "${oldip}" -a "${oldip}" != "${ip}" ]
        then
                /sbin/pfctl -t $TABLE -T del ${oldip} > /dev/null 2>&1
        fi

        if [ -n "${ip}" ]
        then
                /sbin/pfctl -t $TABLE -T add ${ip} > /dev/null 2>&1
        fi
done < $GOODGUYS

This reads a list of hostnames from /root/goodguys.txt and adds each resolved address to the table goodguys and stores the result in /tmp for later use. If the previous address is different than the current resolved address, the previous address is deleted from the goodguys table.

Place it in, say /root/bin/goodguys.sh

And here's what you'd add to /etc/crontab to do this every 5 minutes:
Code: [Select]
#minute hour    mday    month   wday    who     command
*/5     *       *       *       *       root    /root/bin/goodguys.sh

Voila! I find this to be the best solution of all the bruteforce solutions. Everyone is blocked except for you and friends ... granted you and your friends are using their own machines. No special software or firewall rules needed and most importantly NO ANNOYING AUTH LOG FAILURE MESSAGES!

Caveats
  • It may take several minutes before you can ssh to your server.
  • If your dynamic hostname expires, said hostname may resolve to the dynamic DNS provider.

41
General Discussion / "Technology"
« on: May 17, 2009, 07:44:22 pm »
Not that I'm a Luddite, but why do new TVs connect to the Internet to download updates, why do Blue Ray players boot an OS?  Why in God's earth do we need a cellphone app that can remotely control our DVR... Is this "technology"?  Are you kidding me?  This is blatant abuse of technology!  I have no problem with real technology: computers, GPS, medical treatments, hurricane models...things that do real good in the lives of people and society.  This other "technology" is doing nothing more than cluttering our lives with mediocre luxuries and abusing computers up the ass! People need to get angry about the use of our resources and our best minds!

42
General Security Information / Conficker on 60 minutes
« on: March 29, 2009, 11:53:46 pm »
So apparently the Conficker worm is so bad that it got a segment on 60 minutes.  Beware, it was said that on April 1st it will get new instructions.  Considering that some 10 million or so are infected, this scares me.  But seriously, aren't there people so incredibly ticked off at worms and viruses that they make their own anti-worm worms and anti-virus viruses (viruses/worms that clean out viruses/worms forcibly).

http://www.microsoft.com/security/portal/Entry.aspx?Name=Worm:Win32/Conficker.D

43
General Programming / C++ limitations
« on: February 04, 2009, 11:18:18 am »
I always feel the grass is greener on the other side when it comes to C and C++
When in C, I look at C++ and think how great STL is.
When in C++, I look at C and think how much more flexible it is.

However, one thing that really annoys me about C++ that is easily accomplished in C is partial construction of objects.

For example, say you have a hierarchy of inheritance of objects and you have static factory functions in each.  Factory functions are useful in situations where you don't know the specific type of object to construct.  For example, you might need to read variable types of objects from a file ... this cannot be accomplished with ordinary constructors.  Ideally, the hierarchy of factory functions deal specifically with reading data specific to their object.  However, you run into a boot strap problem (you want to lift yourself up with your own boot straps).  The parent factory acquires an object from a child factory that is determined at run time...but the child factory might need parent-specific data to invoke the parent's constructor to construct itself to begin with.

Why can't C++ allow partial constructors and allow the programmer to manually bind objects?
Code: [Select]
Base *base = new partial Base; // Only Base is constructed...Base could be purely abstract
Derived *derived = new partial Derived; // Only Derived is constructed

bind_objects(base,derived); // Now base is bound to derived

Rebinding objects would be nice too.

Inheritance is a run-time feature...why try to hide this fact?  There's no good reason to disallow partial constructors or manual binding of objects.

44
General Programming / Error checking and paranoia
« on: January 16, 2009, 10:15:52 am »
This is pretty heavy handed question, but when does error checking/handling become paranoia?  I find myself spending most of my time writing error checking/handling code and I feel like its mostly counter productive.  In some circumstances, if code fails, the system is screwed anyways.  It's just not clear where one draws that line.  A related, and equally difficult, question is when do you allow software to crash itself?  I do believe that general criteria could be developed to address these questions.  What do you think?

45
General Programming / Design Question
« on: January 20, 2008, 02:40:22 pm »
This is my first post here in quite a while!

Some background...
Over Christmas break I've devised a more generalized design for tunsl.  It is based on BSD's netgraph.
tunsl has been re-interpreted as a series of "filters", each with very simple tasks.  A filter is an interface that has: send, attach, detach, control, and shutdown functions.  These functions are hung in a struct.  filter also has linked lists for input and output consumers.  Additionally a filter is one way.  Filters can only send to locally attached filters either by broadcasting or by traversing the output consumer linked list and invoking selected filter send functions (one can send to input consumers...but that disrupts the conceptual "flow" of data).

To alleviate confusion:
An input consumer is a filter that accepts input
An output consumer is a filter that generates output

The advantages of this construct are:
1) tunsl's operations are reduced into simple tasks
2) tunsl is incredibly extensible...filters can be attached anywhere in the filter network...they are like legos

tunsl itself, is a set of 4 filters, composed of logic and cryptographic pairs of input/output filters (remember, they are 1 way).  The logic and crypto pairs are attached to each other.
A network filter is attached to the logic pair.  The interface filter is attached to the crypto pair.

A network filter is a filter that inputs/outputs to the peer-to-peer network over any supported medium (e.g. tcp, udp, bluetooth, etc...)
An interface filter is a filter that inputs/outputs to programs (e.g. tun, SOCKS5, etc...).  This allows programs to transparently access the peer-to-peer network over a variety of different mediums, protocols, and so forth.

So my question...
I want to separate network and interface filters from tunsl's core.  There are variety of ways this can be achieved.  Here are a few ways this could be achieved...but whats the best way or whats better?

Think of each filter/subsystem as a shared object (or DLL).  Load these at runtime determined by command line flags or config file.  Now we need to provide subsystem/filter specific information by either

1) Create one tunsl config file with nests for logical separation...pass the configuration parser context to each loaded module so that it can get its configurations.
2) Hardwire a configuration file path for each module and allow them to aquire their own configurations upon load
3) Create a tunslcfg utility, synonymous to ifconfig and use a script to load settings through tunslcfg.

I like 1 or 3 personally...but whats the best way?  I like 1 because it allows one to consolidate all settings to one file and if someone wanted to use an alternative configuration file, they could do so by having tunsl open an alternative file (e.g. like a -c flag).  I like 3 because UNIX configures network interfaces in this manner...but it would require a lot more work.

Pages: 1 2 [3] 4 5