- Details
- Category: Blog
- By Stuart Mathews
- Hits: 5547
Since Convolution, Running and Finite State Machines, I've spent the last couple of days focused on reading lotsa different stuff.
I'm currently alternating between a few books: "Introduction to 3D Game Programming with DirectX10", which is by Frank D Luna. It's quite technical however, it's accurate and provides good perspective, particularly around the basic math such as vectors and Matrices.
I'm also reading Rautenbach's "3D Game programming Using DirectX10 and OpenGL", which is one of my favourites reads on the subject. I think it is primarily because it does the best coverage of 3D transformation I've ever read and its got great illustrations too.
With "Foundations and fundamentals concepts of mathematics", I'm taking a history lesson at the moment into the axiomatic, deductive method used throughout history in describing math. I've been reading about the development of the deductive method used by Euclid and Archimedes and some of the histories behind how varying degrees of assumptions including Axioms and Postulates and how they are used, how they were formed and it is pretty insightful. It's theoretical but/and pleasingly so.
On a more practical note, I'm now also reading "A programmers introduction to mathematics" where we're trying to implement a secret code sharing mechanism using polynomial theory, which is a little more practical. This book takes a little longer to read than the others but I'm quite interested in it.
Last in my round-robin of reads is "A mind for numbers", which is more inspirational than technical and sits squarely within the genre of some my previous 'popular research' reads such as "Mindset" and "Bounce" as well as "The Checklist". It reads more like a novel/story than a technical book.
Apart from physical the books, which are stacked up next to me on my coffee table, I've been wondering the passages of the internet too. I recently came across a BBC learning page about computer science fundamentals.
It introduces algorithms such as those used for searching including linear and binary search methods and sorting too using methods such as bubble sort, selection sort, merge sort etc.
Its a series largely aimed at children but it has real application (just like any math would) and I found it particularly interesting and fun, which perhaps further suggests that perhaps I've not yet grown up.
It also maybe suggests that some computer science fundamentals are a little more known to children that they have ever been before as it was surprisingly well documented and entertaining as it included videos, examples and was suitable 'gamified'. The only thing missing I found was actual code implementations...
I spent some time implementing some of them for fun as I wanted to test myself.
My first test was implementing Bubble Sort - a linear time, O(n) sorting algorithm, pretty inefficient and slow but it's got a very defined and coordinated setup which makes it easily modelled.
I used a do() iteration construct, as you'll be swapping at least once and I count the number of swaps done through each iteration or 'pass' running through the list of numbers. The process ends when there are no more swapping to be done, which forms part of my exit condition in my loop and then the list is sorted:
public static void BubbleSort(ref int[] input)
{
int swapped;
do
{
swapped = 0;
for (int i = 0; i < input.Length-1; i++)
{
if (input[i] > input[i + 1])
{
var temp = input[i];
input[i] = input[i + 1];
input[i + 1] = temp;
swapped++;
}
}
} while(swapped > 0);
}
It was actually pretty fun doing this, and can surely be improved upon - Next, I tried the insertion sort:
Insertion sort
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
This is a little more difficult because you need to 'look' back to see if any prior elements, so it needs a nested loop. One loop for the initial pass-through of each of the elements and then for each element, scan the previous elements leading up to the element. Pretty inefficient, somthing in the region of say O(n^2) I'd imagine, but totally something that can be modelled in code:
public static void InsertionSort(ref int[] input)
{
for (int i = 0; i < input.Length; i++)
{
for (int j = 0; j < i; j++)
{
if (input[i] < input[j])
{
var save = input[j];
input[j] = input[i];
input[i] = save;
}
}
}
}
These all sorted the list in-place. I stopped there but I'm going to add a few in the future, probably the more complicated and more efficient ones as it's a pretty interesting and enlightening process, and helps me practise.
So in other news, I've finally completed my Network Security course, and I'm pretty much done with the Digital Signal Processing. Actually, the last piece of work I did on it was the course work(which ultimately replaced the exam) was where I needed to implement a Circular Buffer and then use it in creating audio effects in C++ using fmod, among other things.
One example of this was creating a delayed(or time-shifted) signal effect like a flanger...
This is what I ended up doing in C++:
One of the other things I had to do, was set up an occlusion effect whereby walking in front of an object would effectively cut off sound originating from the object.
I used FMods geometry system to construct a polygon that represented a wall and positioned that in front of my object. I then registered it with the fmod system. Pretty fun as we had to import a new mesh and render it in the OpenGL - which was the first time I'd used OpenGL.
Looking back at my DSP course, I actually enjoyed it, particularly the theory but also too the C++ and the work I did on the ringbuffer. We covered aspects including:
- Logarithms, Real and complex numbers
- Sampling and Quantization analogue continuous signals into digital
- Wave theory and properties of waves
- Signal correlation and the Fourier transform: Dot product, Autocorrelation, Cross-correlation, Cross-co-variance, the Correlation coefficient
- Frequency Analysis
- Filtering and convolution
I enjoyed learning about the Fourier transform the most, and I suspect in the future I'll be using it again...
Apart from my Network Security and DSP course, which has taken a lot of my spare time, I also managed to also complete the Game Architecture course.
As a result, I've written a game engine in C# and MonoGame and produced a representable prototype to represent it. The main concepts covered include:
- Resource Management Strategy
- Character Control and Decoupled Input
- Collision Detection
- Moving and animated game elements and frame-rate independence
- The configurable game world and data-driven approach
- Decoupled removal of game objects from collision detection
- Scoring System use of event listeners
- High score or alternative state load/save mechanism
- Start-screen with FSM
- Power-ups using event listeners and re-use of base classes for game objects
- NPC opponents demonstrating FSM
- Overall game-play and presentation
I have a bit of a demonstration of a PAC-man like game which features collision detection, primitive AI and animation. It's very basic and is really just a prototype (not a whole game) to demonstrate the underlying architectural designs and concepts in the game code:
I started with a simple concept of a GameObject which takes on a lot of the functionality and responsibility of typical game situations such as calculating bounding boxes, doing collision detection and common updating routines, drawing and initializing of components etc.
Apart from the actual coding which has taken a lot of my time, I've also spent a considerable amount of time distilling the design decisions of my game engine into a report, which really helped me take stock of all the code I'd been writing, specifically the architectural aspects.
There have been a A few runs during the stay-in phase which are notable.
Yesterday, I put in Mass Effect 3 into the XBox and played a little bit, enough to cure the Krogen of the Genofage but I died like 20 times before I was able to finish the mission. But the persistence paid off!
I also upgraded my Investment Tracker application to Angular 6 from 5.2 which wasn't that bad however I'm a bit stuck now as I can't upgrade beyond that as I've got a strong dependency on a component that won't upgrade further - which I'll need to look to remove in the future but not a big issue right now.
I'm thinking of doing another project that uses my new knowledge around signal processing to implement a sort of Strava-like application in Angular 8/9 but the jury is out on the schedule of that. I've got a few weeks break before things start going again!
- Details
- Category: Blog
- By Stuart Mathews
- Hits: 3403
Computational power is a fundamental aspect of encryption. It relies on many rounds of computation to produce cipher text (Lian et al, 2012, Putra et al, 2018). Furthermore, encryption relies on the computational difficulty of solving mathematical problems – which, while inherently solvable (determining factors of very large numbers), are not solved quickly enough using the current computational power of today – that is, unless a key is provided (Cesare, 2015) which means that “…our security depends on the speed of computers” (Naughton, 2019 ).
The computational requirements of encryption technology in general may actually reduce confidentiality and privacy. For example, in applications that do not possess sufficient computational resources such as RFID technology, weaker, less secure (and less computationally onerous) are often used instead. (Calmels et al, 2006). Its is likely that this will become problematic in the future when encryption algorithms require even more resources to compute.
In cryptography it is often assumed that cryptographic algorithms are purely mathematical objects (Putra et al, 2010), though as their research has shown, computation of encryption algorithms in hardware such as security chips, often and do can ‘leak’ information about the effects of the computation(power, time, sound, electro-magnetic waves and vibration), which has shown to lead to complete key discovery in AES through what is known as ‘Power analysis attacks’ (Putra et al, 2019). This has been shown to be true of quantum-based computing too (Scarani, 2014) which shows that hardware itself would need to be secured to prevent compromise.
While classic encryption relies on “conventional computational paradigms (ie. deterministic Turing machine”, other alternatives exist such as ‘light-based computing’ which has shown to overcome DES encryption in less time than conventional computing allows. (Sartakhti, 2018).
Even so, with the prediction of Moore’s law, which implies an increasing advancement of processing power(roughly doubling chip performance every 2 years) and the coming of the quantum age, which brings with it the ability of “unrestricted computational power”(Scarani, 2014) to solve these computationally-intensive problems (without a key) within practical reach (Cesare, 2015) - the reliance on purely computation (as a predictor of safe encryption) is starting to show its flaws.
The race is on to move to more secure algorithms - and standardisation and adoption are likely to be obstacles in the migration(Cesare, 2015). Other, perhaps less widely considered notions are who will actually ‘own’ any new cryptographic algorithm and the hardware, particularly those predicted in quantum cryptography and how long will it take for a standard to be agreed?
The “Stanford patents” (which includes Diffie-Helman) and the DES and RSA patents expired in 1997, 1993 and 2000 respectively (Vetter, 2010), which in later years has allowed greater freedom to use without risk of litigation, however has also increased our reliance on them. Furthermore, an interesting question is, will it be expensive and/or exclusive to encrypt data in the short term with newly patented algorithms, requiring one to obtain licenses such as those required to use RSA in the years prior to 1997? (vetter, 2010)
While it appears that encryption’s dependencies on time and computational power are directly related, another worrying scenario are the effects of the future, particularly that which was raised by the Dutch General Intelligence and Security Services : that todays confidential information, when revisited in the future (when such computational restrictions may well be easily achievable ) will expose and unhide all the secrets of yesterday, leading to what some call ‘intercept now, decrypt later’ (Cesare, 2015).
One problem that seem to be resilient, independent of the algorithm technology and the computational(or non-computation) mechanism involved, is the need for network administrators to be able to reason/administer and monitor encrypted traffic, and while encryption standards are open, royalty-free(Vetter, 2010) mechanism exist to legitimately classify and even detect types of applications and protocols in the underlying encrypted traffic (Velan et al, 2015 ) – something that will be increasingly difficult without new encryption standards.
Another problem which plagues anything new, be that new quantum-based cryptography machines, algorithms or much of anything to do with computing – is what time reveals and the future conceals and what US Defence Secretary Donald Rumsfeld eloquently phased “unknown unknowns”.
Quantum cryptography has known issues (citation) as does existing encryption algorithms like DES(Kolata, 1983), and so too will the current state of the art - all are vulnerable to the future and it appears that its just a matter of time before something new and unexpected reveals the next vulnerability. The question and the answer - is how fast can we react?
References
Naughton, J., 2019. We’re still a long way from making a quantum leap in web code-breaking | John Naughton. The Guardian.
Scarani, V. and Kurtsiefer, C. (2014) ‘The black paper of quantum cryptography: Real implementation problems’, Theoretical Computer Science, 560(1), pp. 27–32. doi: 10.1016/j.tcs.2014.09.015.
Greg Vetter (2010) ‘PATENTING CRYPTOGRAPHIC TECHNOLOGY’, Chicago-Kent Law Review, 84, pp. 757–1027.
Salimi Sartakhti, J. and Jalili, S. (2019) ‘On the computational power of the light: A plan for breaking data encryption standard’, Theoretical Computer Science. Elsevier B.V, 773, pp. 71–78. doi: 10.1016/j.tcs.2018.08.015.
Cesare, C. (2015) ‘Encryption faces quantum foe: researchers urge readiness against attacks from future-generation computers.’, Nature. Nature Publishing Group, 525(7568), pp. 167–168.
Kolata, G. (1983) ‘Flaws found in popular code’, Science (New York, N.Y.), 219(4583), pp. 369–370. doi: 10.1126/science.219.4583.369.
Putra, S. D. et al. (2019) ‘Power analysis attack against encryption devices: a comprehensive analysis of AES, DES, and BC3’, TELKOMNIKA (Telecommunication Computing Electronics and Control), 17(3), pp. 1282–1289. doi: 10.12928/telkomnika.v17i3.9384.
Calmels, B. et al. (2006) ‘Low-Cost Cryptography for Privacy in RFID Systems’, in Smart Card Research and Advanced Applications: 7th IFIP WG 8.8/11.2 International Conference, CARDIS 2006, Tarragona, Spain, April 19-21, 2006. Proceedings. Berlin, Heidelberg: Springer Berlin Heidelberg, pp. 237–251. doi: 10.1007/11733447_17.
Velan, P. et al. (2015) ‘A survey of methods for encrypted traffic classification and analysis’, International Journal of Network Management, 25(5), pp. 355–374. doi: 10.1002/nem.1901.
Kapoor, B., Pandya, P. and Sherif, J. S. (2011) ‘Cryptography’, Kybernetes. Emerald Group Publishing Limited, 40(9/10), pp. 1422–1439. doi: 10.1108/03684921111169468.
Lian, J.H. & Chen, K. 2011, "Implementation of DES Encryption Algorithm Based on FPGA and Performance Analysis", Applied Mechanics and Materials, vol. 130-134, pp. 2953-2956.
- Details
- Category: Blog
- By Stuart Mathews
- Hits: 5259
Since Encryption and network protocols, I wrote about Common network attacks and the shortcomings of standard network defences.
Apart from that, I've made some good progress using the classic MonoGame/XNA game tutorial which I manually reproduced a few weekends ago (https://github.com/stumathews/WindowsShooterGame).
I spent most of the day writing it up and trying to figure it out and I think its a great learning exercise. The fundamental concepts of which are to delegate as much detail to co-operating objects and then ask them to update() their states (or modify the world state) and draw themselves().
I've been trying to put into context some of the concepts I've learnt during the Computer Games Architectures course I'm doing too:
Recently we've touched on how to separate the architectural components into layers and how the organisation of components within a typical game engine is laid out. We've put together some theory about architectural design patterns and I'm quite enthused that my reading on the subject, pertain specifically to game development was used as a reference to MVC. I wrote this a while ago before I decided to take the course: A simple game engine architecture. This tells me that I'm doing the right course. There is also some application of physics slowly coming into the course which is great.
I've also spent quite some time learning about digital sampling and the quantisation of analogue signals into digital ones and representing them mathematically.
This is part of the game development course and it goes through the physics of audio. Basic topics include investigating sampling frequencies, downsampling/aliasing, filters, Nyquist frequency, sine, triangle, triangle and sawtooth wave patterns including Envelope generators(ADSR).
I'm also finding the mathematics fascinating, particularly the representation and modelling of waves. I've enjoyed learning about the Fourier transform and as a result, an application of complex numbers - which is something new and therefore interesting.
Last weekend I spent it doing practicals for my Network Security course work. I set up various switches and routers and configuring firewalls and routes. Very interesting. Quite a time-consuming. Details of that setup are here:
I also spent time investigating the EK Angler attack and used some interesting tools that report the attack such as Snort, Sguil, Bro, Elsa and of course...Wireshark. The attack particulars of the attack are quite interesting however the details are quite well described by Palo Alto networks here.
I used the Security Onion VM to research. I've long since uninstalled Tails...
Since then, however, I've been focusing on digital signal processing and physics. I've spent most of this weekend, going through a set of lessons described as the recommended reading. If I'm going to pass the exam, I've got to study as much of it as I can within the time I have left.
I think the most useful, apparent link I've made to gaming with regards to the theory of waves, which does seem out of place - is the representation of Tones or harmonics ie, that when running through an ASDR envelope, produce a noticeable variation of the sound which is very reminiscent of game sounds (less sharp but more tapered loudnesses). This is in fact exactly what ASDR envelopes do - they modulate the loudness over the duration of the tone. In other words, it's apparent that tones in games have been run through an ADSR envelope to make them sound better.
The mathematics is dry due to its abstractness however the fun is extracted by applying it to real practical pictures and realisation of ideas and concepts like - the motion of pressure waves, compressions and rarefaction. It also makes for more enlightened appreciation.
It's clear that there is a lot of work still to do, for example, the 2-hour lectures hide many details and the various aspects that you need to spend like I did this weekend - 2 days to appreciate and fully understand! There is a good chance If I don't focus on the detail, pay attention and study now, then in a couple of weeks, I'll be far too behind to catch-up adequately.
The maths work, particularly with my tendencies to solely focus on non-physics and non-mathematics related ideas daily such as solving theoretical problems or modelling problems in code, leaves much to be practised, especially to participate adequately in the mathematical domain. This might seem daunting but I find it quite empowering as I need to learn new things which I'm not used to which adds variety to my attention.
Speaking on logical problems that I face each day, these don't have standardised rules and laws that mathematics and physics have. For example, I don't need to manipulate or model problems as known mathematics algorithms such as coding around creating sine waves. That being said, I've already seen that this will change in gaming: I was reading code recently that made level objects bounce in a sine wave pattern/form...expressed that using sine waves in the code. That is something I don't do every day!
I think my everyday non-game related problems are logical - almost implicit, theoretical reasoning-related problems, not explicit formal manipulations of discrete math. That being said, I've found that my every-day type of thinking is more akin to the kind of thinking one does in physics - more contemplative, reflective and then I suppose, applicative by the realisation of code. Though, this might be a fallacy.
I also spent this weekend writing some code to decouple the input sensing code from the action that is performed as a result of that input sensing code. This is one of the key ideas that the computer games architectures course teaches. We're using Monogame and I was using events and delegates to represent this.
There is a lot to learn, and much sleeping has not happened because of it.
In other news, my trusty reliable laptop has started to show its age, though not in ways you might think. I've used the same laptop for almost 9 years and I've not noticed a single thing that appears to me that it's getting old. Ok, it might look old: https://www.cnet.com/reviews/lenovo-thinkpad-x220-review/, and the guy next to me in my gaming class says it looks like a big calculator! And I agree it ain't pretty, though Ironically, his gaming laptop is like a spaceship...not pretty either.
Anyway, I can run many browser tabs, none of the applications is slow - no degradations at all. So how has it shown its age? Unfortunately in the unlikeliest of places: drivers.
My graphics card, while absolutely capable of OpenGL cannot be used in Windows 10 because of the driver manufacturers (intel) have not added support for OpenGL for my particular graphics card, in Windows 10. So, its a limitation of the driver implementation in Windows 10, not the machine. If I ran Windows 8.1 - it would work ok. Attempts to get MonoDevelop and MonoGame on Ununbu are thus far inconclusive. Annoying.
With regards to my physical routine, with all the work and study, late nights and constancy of focus - waking up in the morning early to go to the gym has taken a hard hit. I went to the gym for the first time in months yesterday and it was tough. One thing that has offset this has been my running into the city. I've been able to do this with more frequency.
One noticeable change is that I've switched over from Strava Premium to TrainingPeaks. I'm following my fitness level through its TSS score and associated calculations.
More Articles …
- Common network attacks and the shortcomings of standard network defences
- Encryption and network protocols
- BYOD and Implications for Network Security
- Mazer Game Design and Network Security
- Thoughts on Creativity And Originality
- Game Dev, Forensics, Math and stuff
- Fortune favours the brave
- Changing object states and 3D transformations
- Autopsy, a crash and some DirectX10
- Rules then Since then
Page 20 of 182