- Published on
KembaraXtra- Computer Science - Bitcoin
I. Cryptocurrency Fundamentals
A. Definition
A. Origin
A. Core Concept
A. Storage
A. Definition
A. Definition
A. Genesis Block
A. Bitcoin Anonymity
I. Cryptocurrency Fundamentals
A. Definition
- A digital asset used for financial transactions, serving as an alternative to traditional currencies.
- Transactional: Spending currency on goods/services.
- Investment: Similar to gold; value is stored/speculated on.
- No single controlling organization.
A. Origin
- The first decentralized cryptocurrency, introduced in 2009.
- Most well-known cryptocurrency, with many alternatives ("altcoins") but none as dominant.
- Bitcoin (BTC).
A. Core Concept
- Information grouped into chronological "blocks" linked together.
- Blocks contain transaction records (movement of bitcoins).
- Operates over a network (e.g., the internet).
- Multiple computers ("nodes") process transactions and update the blockchain.
- No single master copy of the blockchain.
- Encryption/Decryption: Ensures transaction integrity and prevents tampering.
- Immutability: Data cannot be changed once written to the blockchain.
- Decentralized, immutable record of all Bitcoin network transactions.
A. Storage
- Bitcoins are associated with key pairs held in a Bitcoin wallet.
- The wallet holds cryptographic key pairs (private and public keys).
- Private Key: Randomly generated 256-bit number; must be kept secret. Allows spending of associated bitcoins.
- Public Key: Derived from the private key; used to receive bitcoins.
- Text string generated from the public key; used to represent the public key when receiving bitcoins.
- Example: 13pB1brJqea4DYXkUKv5n44HCgBkJHa2v1
- Sender needs the recipient's Bitcoin address (derived from their public key).
- Sender uses their private key to authorize the transaction.
- Recipient's private key is never shared.
A. Definition
- A transfer of bitcoins.
- Wallet software constructs a transaction.
- Transaction details (sender, receiver, amount) are specified.
- Digitally signed with the sender's private key.
- Broadcast to the Bitcoin network.
- Network computers verify the transaction.
- Transaction added to a new block on the blockchain.
- Inputs: Source of the bitcoins being transferred. Refers to a previous transaction's output, not directly to a Bitcoin address.
- Outputs: The address where the bitcoin is sent.
- Not explicitly stored in the wallet or directly in the blockchain.
- Calculated from the history of transactions associated with an address.
A. Definition
- The process of maintaining the Bitcoin blockchain.
- Computers around the world that add blocks of transactions to the blockchain.
- Verify Transactions: Ensure each transaction in the block is valid.
- Solve a Complex Problem: Miners must solve a computationally difficult problem (proof of work).
- Deters tampering with the blockchain.
- Altering a block requires re-solving the problem for that block and all subsequent blocks.
- The first miner to solve the problem is awarded a sum of bitcoins.
- This is how new bitcoins are created.
- Miners also claim transaction fees from transactions included in the block.
- Designed to allow only 21 million coins to be mined in total.
- After that, miners will rely solely on transaction fees.
A. Genesis Block
- The first block in the Bitcoin blockchain, mined in 2009.
- Inventor of Bitcoin (presumed pseudonym).
- Mining costs (hardware, electricity) must be less than the value of bitcoins awarded.
- Specialized hardware is used for faster mining.
- Mining is not a guaranteed profit due to costs and price volatility.
A. Bitcoin Anonymity
- The blockchain is public (all transactions are visible).
- However, personal identities are not directly linked to addresses.
- Attracts those seeking anonymity.
- Can be used beyond cryptocurrencies.
- Suitable for any system needing a tamper-resistant record history.
- Published on
KembaraXtra-Computer Science - Deep Web and Dark Web
I. Overview
I. Overview
- The internet can be divided into three layers:
- Surface Web
- Deep Web
- Dark Web
- The terms "Deep Web" and "Dark Web" are often confused but have distinct meanings.
- Definition: Content freely available and accessible to anyone.
- Examples: Public blogs, news sites, public social media posts (e.g., public Twitter posts).
- Indexing: Indexed by search engines (Google, Bing, etc.).
- Accessibility: Can be found using standard search engines.
- Definition: Web content that cannot be accessed without logging in or specific credentials.
- Accessibility: Requires a password or login to access.
- Examples:
- Checking your bank balance online.
- Reading your email through a web service (Gmail, Yahoo, etc.).
- Logging into social media accounts (Facebook, Instagram, etc.).
- Viewing personal shopping history on e-commerce sites (Amazon, etc.).
- Indexing: Not indexed by search engines; therefore, not publicly available.
- Reason for Non-Indexing: To protect sensitive, private user data.
- Definition: Web content that requires specialized software to access.
- Accessibility: Cannot be accessed with a standard web browser.
- Key Technology: Tor (The Onion Router) is the most prevalent technology.
- Tor Functionality:
- Enables anonymous access to the web.
- Uses a system of encryption and relays.
- Hides the user's IP address, preventing ISPs from monitoring browsing activity.
- Prevents visited sites from knowing the visitor's IP address.
- Onion Services: Websites accessible only through Tor, and are part of the Dark Web. They also hide their IP addresses.
- Anonymity: Both users and websites can remain anonymous.
- Use Cases:
- Criminal Activity: Anonymity can be exploited for illegal purposes.
- Legitimate Purposes:
- Whistleblowing
- Political discussion
- Caution: Exercise caution when accessing content on the dark web.
- Published on
KembaraXtra-Computer Science - Cloud Computing
I. Introduction to Cloud Computing
I. Introduction to Cloud Computing
- Definition: Delivery of computing services over the internet.
- Shift from centralized to local to remote computing.
- Cloud computing allows on-demand purchasing of computing services.
- Early Days: Centralized computing with servers accessed via terminals.
- Shift to Local: Desktop computers handled processing locally.
- Return to Remote: Web-based applications accessed via local smart devices.
- Modern applications use a mix of local and remote processing.
- Maintaining servers is complex and costly (hardware, software, security, capacity planning).
- Organizations want to focus on their core purpose, not server maintenance.
- Cloud providers handle the underlying hardware and infrastructure.
- Defined by the division of responsibility between cloud provider and consumer.
- Four main categories: IaaS, PaaS, FaaS, SaaS
- Provider: Manages hardware and virtualization.
- Consumer: Manages OS, runtime environment, application code, and data.
- Example: Virtual computer (VM or container) accessed over the internet.
- Responsibility: Consumer maintains all software on the virtual computer.
- Examples: Amazon EC2, Microsoft Azure Virtual Machines, Google Compute Engine
- Provider: Manages hardware, virtualization, OS, and runtime environment.
- Consumer: Develops and manages the application code.
- Benefit: Consumer doesn't maintain the underlying OS or runtime environment.
- Responsibility: Consumer manages application and provisions resources (storage, VMs).
- Examples: AWS Elastic Beanstalk, Microsoft Azure App Service, Google App Engine
- Provider: Manages all infrastructure and on-demand execution of code.
- Consumer: Only deploys code (functions) that run in response to events.
- Model: Event-driven.
- Serverless Computing: Consumer doesn't manage servers.
- Responsibility: Consumer writes code that runs in response to events.
- Examples: AWS Lambda, Microsoft Azure Functions, Google Cloud Functions
- Provider: Fully manages the application in the cloud.
- Consumer: Uses the complete application.
- Contrast: Differs from installing and maintaining software locally.
- Responsibility: Consumer manages the data they store in the application.
- Examples: Microsoft 365, Google G Suite, Dropbox
- Amazon Web Services (AWS)
- Microsoft Azure
- Google Cloud Platform (GCP)
- IBM Cloud
- Oracle Cloud
- Alibaba Cloud
- Runtime Environment: Environment in which an application executes (libraries, interpreters, etc.).
- Virtualization: Creating a virtual (rather than actual) version of something, such as a computer hardware platform, operating system, storage device, or network resources
- Serverless Computing: Cloud computing model where the provider manages servers, and the consumer doesn't need to manage them.
- Event-Driven Model: A programming paradigm in which the flow of the program is determined by events (e.g., user actions, sensor outputs, messages from other programs/threads).
- Published on
KembaraXtra- Computer Science -Virtualization and Emulation
I. Introduction
Feature
Virtualization
Emulation
I. Introduction
- Virtualization: Creating a virtual representation of a computer using software.
- Emulation: Enabling applications designed for one type of device to run on a different type of device.
- Virtual Machine (VM): A virtual computer that runs an operating system and applications, similar to a physical computer.
- Applications running on a VM perceive the virtualized hardware as a physical computer.
- Benefits of Virtualization:
- Run multiple operating systems on a single physical machine.
- Datacenters can host multiple virtual servers on one physical server.
- Easy to back up, restore, and deploy VMs.
- Hypervisors: Software platforms that run virtual machines.
- Type 1 Hypervisor: Interacts directly with the underlying hardware, sitting below the kernel.
- Examples: Microsoft's Hyper-V, VMware ESX.
- Type 2 Hypervisor: Runs as an application on an operating system.
- Examples: VMware Player, VirtualBox.
- Type 1 Hypervisor: Interacts directly with the underlying hardware, sitting below the kernel.
- Containers: Provide an isolated user mode environment for running applications.
- Share the kernel with the host OS and other containers.
- Processes in a container can only access a subset of the host's resources (e.g., isolated filesystem).
- Provide isolation similar to VMs but without the overhead of a separate kernel.
- Typically limited to running the same OS as the host.
- Examples: OpenVZ (virtualizes the entire user mode), Docker (runs individual applications).
- Definition: Using software to make one type of device behave like another.
- Key Difference from Virtualization:
- Virtualization offers a slice of the underlying hardware.
- Emulation presents virtual hardware that is unlike the physical hardware.
- Example: Running software compiled for a Sega Genesis (Motorola 68000 processor) on an x86 machine.
- Process: The emulator translates CPU instructions from the original system to instructions that the host system can understand.
- Overhead: Emulation introduces significant overhead because each instruction must be translated.
- Applications of Emulation:
- Preserving software designed for obsolete platforms.
- Enabling old software to run on modern platforms without modification (when source code is lost or modernization is too difficult).
- Definition: Run an application within an execution environment that abstracts away details of the underlying OS.
- Similarity to Emulators: Provides a platform decoupled from the hardware and OS.
- Difference from Emulators: Does not simulate real hardware.
- Purpose: Designed for running platform-independent software.
- Examples: Java and .NET use process virtual machines that run bytecode.
Feature
Virtualization
Emulation
- Published on
KembaraXtra- Computer Science - Apps
1. App Definition & Characteristics
1. App Definition & Characteristics
- Traditional Definition: Software programs used directly by users (interchangeable with "application").
- Modern Meaning: Gained prominence with Apple's App Store (2008).
- Common Characteristics:
- Designed for end users.
- Often target mobile devices (smartphones, tablets).
- Distributed via internet-based digital storefronts (App Store, Google Play Store, Microsoft Store).
- Limited system access; declare required capabilities.
- Primarily use touchscreens for user input.
- Native App: Software installed on a device that directly utilizes the operating system's API.
- Web App: Designed with web technologies (HTML, CSS, JavaScript) and not tied to a specific OS.
- Definition: Built for a specific operating system (iOS, Android).
- Benefits of App Stores:
- New platforms for developers.
- New methods of distribution.
- New ways to monetize software.
- Development Challenges:
- iOS and Android differ in programming languages and APIs.
- Requires separate codebases or cross-platform frameworks (Xamarin, React Native, Flutter, Unity) for multi-platform support.
- Many apps rely on web services.
- Cross-Platform Frameworks: Abstract underlying OS API details, enabling code to run on multiple platforms.
- Historical Context:
- Steve Jobs initially envisioned web apps as the primary means for third-party development on the iPhone.
- Apple later reversed course, allowing native app development and opening the App Store.
- Benefits of Native Apps & App Stores:
- Revenue source for platform holders (Apple, Google, Microsoft).
- Exclusive content.
- Curated list of apps with ratings.
- Consumer trust (quality guidelines).
- Centralized payment service.
- Automatic updates.
- Drawbacks:
- Complex environment for developers (multiple stores, platforms, technologies).
- Each marketplace has specific requirements and takes a percentage of revenue.
- Definition: Websites that function like apps, built using web technologies (HTML, CSS, JavaScript).
- Advantages:
- Run on any device with a modern web browser.
- Code only needs to be written once.
- Disadvantages:
- Don't have full access to device capabilities.
- Tend to be slower than native apps.
- Require an internet connection.
- Generally not listed in app stores.
- Responsive Web Design: Ensures web content renders well on various screen sizes, allowing for a single website across devices.
- Web Development Frameworks: Angular, React, Vue.js simplify web app development and maintenance.
- Definition: Websites with extra features that bridge the gap between native apps and web apps.
- Requirements:
- Served over HTTPS.
- Render appropriately on mobile devices.
- Load offline once downloaded.
- Provide a manifest describing the app.
- Transition quickly between pages.
- User Experience: Feel responsive and natural, like a native app.
- Benefits:
- Use web technologies for apps without building multiple platform-specific apps.
- Users can add a PWA icon to their home screen or desktop, launching it like a native app in its own window.
- Drawbacks:
- Don't appear in app stores (except Microsoft Store).
- Users aren't used to installing apps from websites.
- May not look exactly like native apps (look similar across platforms).
- May not have the same performance or full access to platform capabilities as native apps.
- Published on
- Published on
- Published on
KembaraXtra -Computer Science -World Wide Web
Core Attributes
Distributed
HTTP (HyperText Transfer Protocol)
ii.Server hello: Server selects the encryption methods. The server provides its public key.
iii.The client encrypts a string of bytes with the server's public key, and sends it to the server.
iv.Server decrypts using its private key. Both compute a shared secret key for symmetric encryption.
v.All further data is encrypted using the shared secret key.
The Searchable Web
Core Attributes
Distributed
- Definition: No central authority controls web content.
- Implications:
- Anyone can host a web server and publish content.
- Organizations/countries can block access.
- Governments can shut down illegal content.
- Key Point: The web is open and not centrally controlled.
- Definition: Every web resource has a unique address (URL).
- URL Components:
- Scheme: Protocol (e.g., HTTP, HTTPS).
- Authority:
- Hostname (e.g., travel.example.com).
- Optional: Username, Port Number.
- Path: Location of resource on server (like a file system path).
- Query: Modifies the resource returned (format varies by site).
- Relative URLs:
- Omit scheme, hostname, or full path.
- Interpreted relative to the current context.
- Practical URL Reading Example:
- Uses HTTP protocol.
- Server: travel.example.com.
- Path: /destinations/carolinas.
- Query: location=beach (shows beach locations).
- Definition: Web resources reference each other via hyperlinks.
- Hyperlinks: One-way references, no permission needed.
- Hypertext: Documents connected by hyperlinks.
HTTP (HyperText Transfer Protocol)
- Purpose: Transferring web resources (reading, creating, updating, deleting).
- Foundation: Based on TCP/IP for reliable data transfer and addressing.
- Model: Request and response.
- Client sends an HTTP request.
- Server replies with an HTTP response.
- GET: Retrieve a resource (no modification).
- PUT: Create/modify a resource at a specific URL.
- POST: Create a new resource as a child of an existing URL.
- DELETE: Remove a resource.
- Usage:
- GET is most common (used for browsing and loading resources).
- Servers often restrict PUT, POST, DELETE.
- Format: 3-digit number.
- Classes:
- 100s: Informational.
- 200s: Success.
- 300s: Redirection.
- 400s: Client error.
- 500s: Server error.
- Examples:
- 200 OK: Success.
- 301 Moved Permanently: Redirect to a new URL.
- 401 Unauthorized: Authentication required.
- 403 Forbidden: Access denied.
- 404 Not Found: Resource not found.
- 500 Internal Server Error: Server-side error.
- Request:
- First line: Method URL HTTP/Version (e.g., GET /documents/hello.txt HTTP/1.1).
- Headers: Additional information.
- Optional message body.
- Response:
- First line: HTTP/Version Status Code Response Phrase (e.g., HTTP/1.1 200 OK).
- Headers.
- Optional message body.
- Purpose: Encrypt data transmitted over the internet.
- Encryption: Encoding data to be unreadable without decryption.
- Cryptographic Key: Secret sequence of bytes used for encryption/decryption.
- Encryption Types:
- Symmetric: Single shared key for both encryption and decryption.
- Asymmetric:
- Public key: Encrypts data.
- Private key: Decrypts data (kept secret).
- Security:
- Prevents interception and modification of data.
- Encrypts the entire HTTP request (URL, headers, body).
- TLS (Transport Layer Security): Protocol used to encrypt HTTP requests (formerly SSL).
- HTTPS Handshake:
ii.Server hello: Server selects the encryption methods. The server provides its public key.
iii.The client encrypts a string of bytes with the server's public key, and sends it to the server.
iv.Server decrypts using its private key. Both compute a shared secret key for symmetric encryption.
v.All further data is encrypted using the shared secret key.
The Searchable Web
- Entry Point: Often accessed through search engines.
- Search Engines: Non-standard, proprietary systems (e.g. Google). """
- Published on
KembaraXtra-Computer Science-Foundational Internet Capabilities
1. Dynamic Host Configuration Protocol (DHCP)
ii.If the server has the record in its cache, it returns the IP address.
iii.If not, the server queries other DNS servers, starting at the root, to find the record.
iv.The server caches the record for future queries.
4. Networking in Context of Computing
1. Dynamic Host Configuration Protocol (DHCP)
- Purpose: Automatically assigns IP addresses and related network information to devices when they connect to a network.
- Why it's important: Simplifies network configuration for end-users by eliminating the need for manual IP address assignment.
- How it works:
- Discovery: A device broadcasts a message to discover available DHCP servers.
- Offer: The DHCP server offers an IP address from its available pool.
- Request: The device requests the offered IP address.
- Acknowledgment: The DHCP server acknowledges the request, assigning the IP address to the device.
- Lease: IP addresses are leased to devices for a limited time. The device must renew the lease to continue using the IP address.
- DHCP Server: A device on the network configured to provide DHCP services, including managing a pool of available IP addresses.
- Problem: Limited number of public IP addresses available, but many networks have multiple devices.
- Solution: Using private IP addresses for internal network communication and NAT to share a single public IP address.
- Private IP Addresses:
- IP address ranges reserved for internal networks (e.g., homes, offices).
- Ranges: 10.x.x.x, 172.16.x.x to 172.31.x.x, 192.168.x.x.
- Non-routable on the public internet.
- Can be used simultaneously on multiple private networks without conflict.
- Network Address Translation (NAT):
- Allows devices on a private network to share a single public IP address.
- The NAT router modifies the source IP address of outgoing packets to its public IP address.
- When responses return, the router translates the destination IP address back to the correct private IP address.
- Security benefit: Hides devices on the private network from direct exposure to the public internet.
- Proxy Server:
- An alternative to NAT, typically used in corporate networks.
- Operates at the application layer.
- Provides additional features: User authentication, traffic logging, and content filtering.
- Purpose: Translates human-friendly domain names (e.g., www.example.com) into IP addresses.
- Why it's important: Makes the internet easier to use by allowing users to remember names instead of IP addresses.
- Fully Qualified Domain Name (FQDN): The complete DNS name of a computer (e.g., travel.example.com).
- Consists of a hostname (travel) and a domain suffix (example.com).
- Domain: A grouping of network resources managed by an organization (e.g., example.com).
- Resolving a Hostname: The process of querying a DNS server to find the IP address associated with a hostname.
- Mapping:
- One-to-many: A single name can map to multiple IP addresses (used for load balancing and geographic distribution).
- Many-to-one: Multiple names can map to the same IP address (used for web hosting).
- DNS Records: Entries in the DNS database.
- A Record: Maps a hostname to an IP address.
- CNAME Record: Maps one hostname to another hostname (alias).
- MX Record: Used for email services.
- DNS Hierarchy:
- A distributed system with shared responsibility for managing DNS records.
- Root Domain: Top of the hierarchy, contains records for top-level domains (TLDs).
- Top-Level Domains (TLDs): (e.g., .com, .org, .edu).
- Second-Level Domains: Registered under TLDs (e.g., example.com).
- DNS Resolution Process:
ii.If the server has the record in its cache, it returns the IP address.
iii.If not, the server queries other DNS servers, starting at the root, to find the record.
iv.The server caches the record for future queries.
4. Networking in Context of Computing
- The internet is a network of hardware and software enabling communication between devices.
- Data transmission over the internet is based on binary data (0s and 1s).
- Network interfaces (e.g., Wi-Fi, Ethernet) are I/O devices.
- Operating systems use device drivers and software libraries to facilitate network communication for applications.
- Networking devices (routers, switches) are specialized computers.
- Networking extends computing beyond single devices.
- Published on
KembaraXtra-Computer Science - A Trip Through the Internet
Overview
This guide summarizes the journey of data across the internet using the TCP/IP model, illustrating how different devices interact at each layer.
Scenario
Overview
This guide summarizes the journey of data across the internet using the TCP/IP model, illustrating how different devices interact at each layer.
Scenario
- A client device (connected to Wi-Fi) wants to access a web page hosted on a server (connected via wired connection).
- The client knows the server's IP address.
- Application Layer (Client):
- The web browser creates an HTTP request.
- The browser hands off the HTTP request to the OS's TCP/IP stack.
- Transport Layer (Client):
- The TCP layer encapsulates the HTTP payload into a TCP segment.
- It sets the destination port to 80 (standard for HTTP) in the segment header.
- If the data is too large, TCP divides it into multiple segments.
- Internet Layer (Client):
- The IP layer wraps the TCP segment in an IP packet.
- The packet header includes the destination IP address of the server.
- If necessary, IP divides the packet into smaller fragments.
- Link Layer (Client):
- The IP packet is encapsulated in a frame.
- The frame header includes the MAC address of the local router.
- The client's Wi-Fi hardware transmits the frame wirelessly.
- Wireless Access Point:
- Receives the frame.
- Sends the frame to the router (operates at the link layer).
- Router(s):
- Examines the IP packet to determine the destination IP address.
- Encapsulates the packet in a new frame with the MAC address of the next router.
- Sends the new frame on its way.
- This routing process continues through multiple routers.
- Final Router (Server's Subnet):
- Encapsulates the packet in a frame suitable for the server's local network.
- The frame header includes the MAC address of the server.
- Switch (Server's Subnet):
- Looks at the MAC address in the frame.
- Forwards the frame out the appropriate physical port to the server.
- Doesn't need to look at higher layers.
- Server:
- Receives the frame.
- The network interface driver passes the TCP/IP packet up to the TCP/IP stack.
- The TCP/IP stack hands off the HTTP data to the process listening on TCP port 80.
- The web server software (listening on port 80) handles the request.
- Reverse Process (Server to Client):
- The server replies to the client, and the entire process happens again in reverse order.
- Encapsulation: Each layer adds its own header to the data from the layer above.
- Decapsulation: Each layer removes its header to reveal the data for that layer.
- Routers: Operate at the internet layer (primarily) to forward packets between networks based on IP addresses.
- Switches: Operate at the link layer to forward frames within a local network based on MAC addresses.
- Ports: Used by the transport layer (TCP/UDP) to identify specific applications or services on a host.
- Devices interact at different layers of the TCP/IP stack.
- The routing process involves multiple routers, each forwarding the packet closer to its destination.
- The switch forwards data based on MAC addresses within the local network.