Friday, April 24, 2026

Building a 3D Galaxy Star Field with Code: A Complete Guide

 

Building a 3D Galaxy Star Field with Code: A Complete Guide

Creating a 3D galaxy star field is one of the most visually rewarding projects for anyone interested in programming, graphics, or space simulation. It combines creativity with technical skill, allowing you to simulate the beauty of the universe using code. In this blog, we’ll explore how a 3D star field works, the concepts behind it, and provide a working example using Python.

What is a 3D Star Field?

A 3D star field is a simulation where stars are positioned in three-dimensional space and rendered on a two-dimensional screen. The illusion of depth is created by adjusting the position, size, and brightness of stars based on their distance from the viewer.

Unlike a simple 2D star background, a 3D version gives the feeling of flying through space—similar to hyperspace effects seen in science fiction movies.

Core Concepts Behind a 3D Star Field

Before jumping into code, it’s important to understand a few basic ideas:

1. Coordinate System

Each star exists in 3D space with coordinates:

  • x (horizontal position)
  • y (vertical position)
  • z (depth/distance from the viewer)

2. Perspective Projection

To display a 3D point on a 2D screen, we use projection:

  • Stars closer to the viewer appear larger
  • Stars farther away appear smaller

A simple projection formula:

screen_x = (x / z) * scale + center_x
screen_y = (y / z) * scale + center_y

3. Movement Simulation

To simulate motion:

  • Decrease the z value over time
  • When a star reaches the viewer (z ≈ 0), reset it to a distant position

Tools You Will Use

We’ll use:

  • Python
  • Pygame (for graphics rendering)

You can install Pygame using:

pip install pygame

Step-by-Step Python Implementation

Here is a complete working example:

import pygame
import random
import math

# Initialize Pygame
pygame.init()

# Screen setup
WIDTH, HEIGHT = 800, 600
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("3D Star Field")

clock = pygame.time.Clock()

# Number of stars
NUM_STARS = 300

# Star class
class Star:
    def __init__(self):
        self.reset()

    def reset(self):
        self.x = random.uniform(-WIDTH, WIDTH)
        self.y = random.uniform(-HEIGHT, HEIGHT)
        self.z = random.uniform(1, WIDTH)

    def update(self, speed):
        self.z -= speed
        if self.z <= 1:
            self.reset()

    def draw(self, screen):
        # Perspective projection
        sx = int((self.x / self.z) * WIDTH/2 + WIDTH/2)
        sy = int((self.y / self.z) * HEIGHT/2 + HEIGHT/2)

        # Star size based on depth
        size = int((1 - self.z / WIDTH) * 5)
        if size < 1:
            size = 1

        # Draw star
        pygame.draw.circle(screen, (255, 255, 255), (sx, sy), size)

# Create stars
stars = [Star() for _ in range(NUM_STARS)]

# Main loop
running = True
speed = 4

while running:
    clock.tick(60)
    screen.fill((0, 0, 0))

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    # Update and draw stars
    for star in stars:
        star.update(speed)
        star.draw(screen)

    pygame.display.flip()

pygame.quit()

How This Code Works

Star Initialization

Each star is randomly placed in a 3D space:

  • Wide x and y range
  • Large z value to simulate distance

Update Function

Every frame:

  • Stars move closer by reducing z
  • If a star gets too close, it resets

Drawing Stars

The projection formula converts 3D coordinates into 2D screen positions. The size of the star increases as it gets closer, enhancing realism.

Enhancing the Star Field

Once you have the basic version working, you can add more advanced features:

1. Color Variation

Instead of white stars, assign colors:

self.color = random.choice([(255,255,255), (255,200,200), (200,200,255)])

2. Speed Control

Allow user input to control speed:

keys = pygame.key.get_pressed()
if keys[pygame.K_UP]:
    speed += 0.1
if keys[pygame.K_DOWN]:
    speed -= 0.1

3. Trails Effect

Draw a line from previous position to current position for motion blur.

4. Rotation

Apply rotation matrices to simulate galaxy spinning.

Moving Toward a Galaxy Simulation

A true galaxy effect goes beyond random stars. You can:

  • Arrange stars in a spiral pattern
  • Add a central core (dense region)
  • Use mathematical curves for arms

Example idea:

radius = random.uniform(0, max_radius)
angle = radius * spiral_factor
x = radius * cos(angle)
y = radius * sin(angle)

This creates spiral arms like real galaxies.

Performance Tips

  • Limit number of stars (200–1000 is ideal)
  • Use integer math where possible
  • Avoid heavy calculations inside loops

Why This Project Matters

Building a 3D star field teaches:

  • Coordinate transformations
  • Real-time rendering
  • Game loop design
  • Mathematical visualization

It’s also a great stepping stone toward game development, simulations, and even graphics programming using advanced tools like OpenGL.

Conclusion

A 3D galaxy star field is a perfect blend of art and science. With just a few lines of code and basic math, you can simulate the vastness of space on your screen. Starting with simple star movement, you can gradually evolve your project into a full galaxy simulator with realistic physics and visuals.

If you keep experimenting—adding rotation, colors, and structure—you’ll end up with something that not only looks impressive but also deepens your understanding of how 3D graphics work.

Thursday, April 23, 2026

Python List Methods Explained with Practical Code Examples

 

Python List Methods Explained with Practical Code Examples

https://technologiesinternetz.blogspot.com


Python lists are one of the most versatile and widely used data structures in programming. They allow you to store multiple items in a single variable and provide powerful built-in methods to manipulate data efficiently. Whether you're a beginner or an experienced developer, mastering list methods is essential for writing clean and efficient Python code.

In this blog, we will explore Python list methods in detail, along with practical code examples to help you understand their real-world usage.

What is a Python List?

A list in Python is an ordered, mutable collection of elements. This means:

  • Ordered: Items have a defined order.
  • Mutable: You can change, add, or remove elements.

Example:

fruits = ["apple", "banana", "cherry"]
print(fruits)

Common Python List Methods

Let’s explore the most commonly used list methods.

1. append()

The append() method adds a single element to the end of the list.

Example:

numbers = [1, 2, 3]
numbers.append(4)
print(numbers)

Output:

[1, 2, 3, 4]

2. extend()

The extend() method adds multiple elements (from another iterable) to the list.

Example:

numbers = [1, 2, 3]
numbers.extend([4, 5, 6])
print(numbers)

Output:

[1, 2, 3, 4, 5, 6]

3. insert()

The insert() method adds an element at a specified position.

Syntax:

list.insert(index, element)

Example:

fruits = ["apple", "banana"]
fruits.insert(1, "orange")
print(fruits)

Output:

['apple', 'orange', 'banana']

4. remove()

The remove() method removes the first occurrence of a specified element.

Example:

fruits = ["apple", "banana", "cherry"]
fruits.remove("banana")
print(fruits)

Output:

['apple', 'cherry']

5. pop()

The pop() method removes and returns an element at a given index. If no index is specified, it removes the last item.

Example:

numbers = [10, 20, 30]
numbers.pop()
print(numbers)

Output:

[10, 20]

With index:

numbers.pop(0)
print(numbers)

6. clear()

The clear() method removes all elements from the list.

Example:

data = [1, 2, 3]
data.clear()
print(data)

Output:

[]

7. index()

The index() method returns the index of the first occurrence of a value.

Example:

fruits = ["apple", "banana", "cherry"]
print(fruits.index("banana"))

Output:

1

8. count()

The count() method returns how many times a value appears in the list.

Example:

numbers = [1, 2, 2, 3, 2]
print(numbers.count(2))

Output:

3

9. sort()

The sort() method sorts the list in ascending order by default.

Example:

numbers = [5, 2, 9, 1]
numbers.sort()
print(numbers)

Output:

[1, 2, 5, 9]

Descending order:

numbers.sort(reverse=True)
print(numbers)

10. reverse()

The reverse() method reverses the order of the list.

Example:

numbers = [1, 2, 3]
numbers.reverse()
print(numbers)

Output:

[3, 2, 1]

11. copy()

The copy() method returns a shallow copy of the list.

Example:

original = [1, 2, 3]
duplicate = original.copy()

duplicate.append(4)

print(original)
print(duplicate)

Output:

[1, 2, 3]
[1, 2, 3, 4]

Bonus: Using Built-in Functions with Lists

Apart from methods, Python provides useful built-in functions:

len()

numbers = [1, 2, 3]
print(len(numbers))

max() and min()

print(max(numbers))
print(min(numbers))

sum()

print(sum(numbers))

Real-World Example

Let’s combine multiple list methods in a practical scenario:

students = ["John", "Alice", "Bob"]

# Add new student
students.append("Emma")

# Insert at specific position
students.insert(1, "David")

# Remove a student
students.remove("Bob")

# Sort list
students.sort()

print(students)

Output:

['Alice', 'David', 'Emma', 'John']

Tips for Using List Methods Efficiently

  • Use append() for adding single items and extend() for multiple.
  • Use pop() when you need the removed value.
  • Avoid modifying a list while iterating over it.
  • Use copy() if you need a separate version of a list.

Conclusion

Python list methods provide powerful ways to manage and manipulate collections of data. From adding and removing elements to sorting and counting, these methods simplify complex tasks and make your code more readable.

Understanding when and how to use each method can significantly improve your programming efficiency. Practice these methods regularly and experiment with your own examples to build confidence.

Lists are fundamental in Python, and mastering them is a big step toward becoming a skilled programmer.

Best VPN Services I Recommend in 2026

 

Best VPN Services I Recommend in 2026

In today’s digital world, privacy is no longer optional—it’s essential. Whether you’re streaming content, working remotely, gaming, or simply browsing, a reliable Virtual Private Network (VPN) protects your data, hides your identity, and unlocks global content. But with hundreds of VPN providers claiming to be “the best,” choosing the right one can feel overwhelming.

After analyzing the latest trends, expert reviews, and performance benchmarks, this blog highlights the best VPN services I recommend in 2026—based on speed, security, privacy, usability, and value.

What Makes a VPN “Best” in 2026?

Before jumping into recommendations, it’s important to understand what actually matters when choosing a VPN today.

The most important factors include:

  • Strong encryption (AES-256 or better)
  • No-logs policy (verified by independent audits)
  • High-speed performance (minimal speed loss)
  • Global server coverage
  • Streaming and geo-unblocking capability
  • Affordable long-term pricing

Modern VPNs also use advanced protocols like WireGuard or proprietary versions for faster and more secure connections.

1. NordVPN – Best Overall VPN in 2026

If you want a VPN that does everything well, NordVPN is the top choice in 2026.

It consistently ranks as the best overall VPN thanks to its perfect balance of speed, security, and usability. It uses advanced encryption, RAM-only servers, and a strict no-logs policy that has been independently audited.

NordVPN is especially strong in:

  • Streaming (Netflix, Disney+, BBC iPlayer)
  • Gaming and fast downloads
  • Advanced security features like Double VPN
  • Threat protection against malware and ads

With thousands of servers worldwide, it ensures stable connections almost anywhere. According to testing, it delivers excellent speeds with minimal performance loss.

👉 Best for: All users—beginners to advanced

2. Surfshark – Best Budget VPN

If you’re looking for value without compromising performance, Surfshark is the best budget VPN in 2026.

Its standout feature is unlimited device connections, meaning you can protect all your devices with a single subscription. It also offers strong security, ad-blocking, and identity protection tools.

Surfshark is known for:

  • Very affordable long-term plans
  • Good speeds (over 1000 Mbps in tests)
  • Clean and user-friendly apps
  • Emerging post-quantum encryption features

While it may not beat NordVPN in advanced features, it delivers incredible value for money.

👉 Best for: Families, students, and budget users

3. Proton VPN – Best for Privacy

If privacy is your top priority, Proton VPN is one of the most trustworthy choices.

Based in Switzerland, it benefits from strong privacy laws and operates with a transparency-first approach. It offers open-source apps and has passed multiple independent security audits.

Key highlights:

  • Strict no-logs policy
  • Open-source infrastructure
  • Secure Core architecture (multi-hop routing)
  • Strong performance across devices

In fact, recent speed tests rank Proton VPN among the fastest VPNs available today.

👉 Best for: Privacy-conscious users, journalists, researchers

4. ExpressVPN – Best for Streaming & Ease of Use

ExpressVPN continues to be one of the most reliable and user-friendly VPNs.

Its simple one-click interface makes it ideal for beginners, while its powerful performance ensures smooth streaming and browsing. It excels at bypassing geo-restrictions and works consistently with global streaming platforms.

Why it stands out:

  • Excellent streaming performance
  • Fast speeds with Lightway protocol
  • Strong security and regular audits
  • Easy-to-use apps across all devices

It may be slightly more expensive, but it delivers premium quality and reliability.

👉 Best for: Streaming lovers and beginners

5. CyberGhost – Best for Beginners

CyberGhost is a great option if you’re new to VPNs and want something simple.

It offers pre-configured modes like “Streaming,” “Gaming,” and “Torrenting,” making it extremely easy to use. It also has one of the largest server networks available.

Key benefits:

  • Beginner-friendly interface
  • Massive server network
  • Dedicated streaming servers
  • Affordable pricing

However, it may not match the speed and advanced features of top competitors.

👉 Best for: First-time VPN users

Comparison Table of Top VPNs (2026)

Feature NordVPN Surfshark Proton VPN ExpressVPN CyberGhost
Best For Overall Budget Privacy Streaming Beginners
Speed Very Fast Fast Fastest Very Fast Moderate
Security Excellent Very Good Excellent Excellent Good
Devices Limited Unlimited Limited Limited Limited
Price Medium Low Medium High Low
Ease of Use Easy Easy Moderate Very Easy Very Easy

What Community Users Say

Interestingly, discussions on platforms show a similar pattern. Users frequently recommend NordVPN, Proton VPN, and Surfshark as top choices based on real-world experience.

“NordVPN delivers the most complete package… ProtonVPN for privacy… Surfshark for value.”

Community feedback highlights the importance of verified no-logs policies, consistent speeds, and transparent operations.

Free VPNs: Are They Worth It?

While free VPNs may sound attractive, most come with serious limitations:

  • Data caps
  • Slower speeds
  • Security risks
  • Potential data logging

One exception is Proton VPN’s free tier, which offers unlimited data with limited features. However, for full protection, paid VPNs are always recommended.

Final Verdict: Which VPN Should You Choose?

There is no single “perfect” VPN—only the one that fits your needs.

  • Choose NordVPN if you want the best all-rounder
  • Choose Surfshark if you want maximum value
  • Choose Proton VPN for top-tier privacy
  • Choose ExpressVPN for streaming and simplicity
  • Choose CyberGhost if you’re just starting

In 2026, VPN technology has evolved significantly, offering faster speeds, stronger encryption, and smarter features than ever before. Investing in a reliable VPN is no longer just about security—it’s about freedom, privacy, and control over your digital life.

Conclusion

As cyber threats grow and online surveillance increases, VPNs have become an essential tool for everyone. The best VPN services in 2026 are not just about hiding your IP address—they are about empowering users with secure, unrestricted access to the internet.

Choosing the right VPN can transform your online experience, giving you peace of mind and the freedom to explore the digital world without limits.

Wednesday, April 22, 2026

New GoGra Malware for Linux Uses Microsoft Graph API for Communications

 

New GoGra Malware for Linux Uses Microsoft Graph API for Communications

https://technologiesinternetz.blogspot.com


Cybersecurity threats are evolving rapidly, and attackers are increasingly turning to legitimate cloud services to hide their malicious activities. One of the latest examples of this trend is the GoGra malware, a sophisticated backdoor targeting Linux systems. What makes this threat particularly dangerous is its clever use of the Microsoft Graph API—a legitimate cloud interface—to communicate with attackers while remaining under the radar.

This blog explores the GoGra malware in detail, including how it works, why it is significant, and what it means for organizations and cybersecurity professionals.

Introduction to GoGra Malware

GoGra is a Go-based backdoor malware that has recently been identified targeting Linux environments. It is believed to be linked to a cyber-espionage group known as Harvester, which has been active since at least 2021 and is known for targeting sectors like telecommunications, IT, and government organizations in South Asia.

Unlike traditional malware that relies on suspicious servers or domains, GoGra leverages trusted Microsoft infrastructure, making it much harder to detect using conventional security tools.

How GoGra Infects Linux Systems

The infection chain of GoGra begins with social engineering tactics. Victims are tricked into executing malicious files disguised as legitimate documents, often appearing as PDF files but actually containing executable ELF binaries.

Once executed, the malware deploys its payload and establishes persistence on the system. It uses techniques such as:

  • Creating systemd services
  • Adding entries in XDG autostart
  • Masquerading as legitimate tools like system monitors

These methods ensure that the malware continues running even after system reboots.

Abuse of Microsoft Graph API

The most unique and dangerous feature of GoGra is its use of the Microsoft Graph API for communication. Instead of connecting to suspicious command-and-control (C&C) servers, the malware interacts with Microsoft Outlook mailboxes.

Here’s how it works:

  1. The malware uses hardcoded Azure Active Directory credentials to authenticate.
  2. It obtains OAuth2 tokens to access Microsoft services.
  3. It connects to an Outlook mailbox via the Graph API.
  4. It continuously checks for new commands hidden in emails.

This approach allows attackers to blend malicious traffic with legitimate cloud activity, making detection extremely difficult.

Command Execution Mechanism

GoGra follows a structured communication model using email messages:

  • It monitors a specific mailbox folder (e.g., creatively named folders).
  • Commands are sent via emails with subjects like “Input.”
  • The malware decrypts the message content using encryption techniques such as AES-CBC.
  • Commands are executed on the infected machine.
  • Results are encrypted and sent back via reply emails labeled “Output.”

After processing, the malware may delete the command emails to remove evidence, further complicating forensic analysis.

Why Using Microsoft Graph API is Dangerous

The use of Microsoft Graph API represents a major shift in cyberattack strategies. Traditionally, malware communicated with external servers that could be blocked or flagged. However, GoGra uses a trusted platform, which introduces several challenges:

1. Stealth and Evasion

Traffic to Microsoft services is usually considered safe, so security systems may not flag it as suspicious.

2. Reduced Infrastructure Costs

Attackers do not need to maintain their own servers. Cloud services like Outlook provide a ready-made infrastructure.

3. Increased Reliability

Cloud platforms offer high uptime, ensuring consistent communication between malware and attackers.

This technique is part of a broader trend where attackers exploit legitimate services to avoid detection.

Targeted Regions and Sectors

GoGra has primarily been observed targeting South Asian organizations, including:

  • Media outlets
  • Government agencies
  • IT and telecom sectors

The focus on specific industries suggests that GoGra is used for cyber-espionage rather than financial gain.

Technical Similarities with Other Malware

Researchers have noted that the Linux version of GoGra shares similarities with its Windows counterpart, including:

  • Identical code structures
  • Shared encryption keys
  • Similar command execution logic

This indicates that both variants were likely developed by the same group and are part of a coordinated campaign.

Additionally, GoGra resembles other malware families that abuse cloud APIs, such as:

  • Graphon
  • BirdyClient
  • FinalDraft

These tools also use Microsoft services to establish covert communication channels.

Persistence and Evasion Techniques

GoGra uses multiple techniques to stay hidden:

  • Frequent polling of the mailbox (every few seconds)
  • Encrypted communications to hide commands
  • Deletion of evidence after execution
  • Use of legitimate APIs to avoid detection

These features make it highly resilient against traditional antivirus and intrusion detection systems.

Impact on Cybersecurity

The emergence of GoGra highlights several critical challenges:

1. Difficulty in Detection

Security systems must now distinguish between legitimate and malicious use of cloud APIs.

2. Expansion to Linux Targets

Linux systems, often considered more secure, are increasingly becoming targets.

3. Rise of Living-off-the-Land Techniques

Attackers are using existing tools and services instead of deploying obvious malicious infrastructure.

How to Defend Against GoGra Malware

Organizations can take several steps to protect against threats like GoGra:

1. Monitor API Usage

Track unusual activity involving Microsoft Graph API, especially unauthorized access to mailboxes.

2. Strengthen Authentication

Use multi-factor authentication (MFA) to prevent unauthorized access to cloud accounts.

3. Endpoint Security

Deploy advanced endpoint detection and response (EDR) solutions to identify suspicious behavior.

4. Email Security

Implement strong email filtering to block phishing attempts that deliver malware.

5. Regular Audits

Conduct periodic security assessments to identify vulnerabilities.

Future Implications

GoGra is not just another malware—it represents a new generation of cyber threats. By exploiting trusted cloud services, attackers are redefining how command-and-control operations are carried out.

As more organizations adopt cloud platforms, attackers will likely continue to abuse these services. This means cybersecurity strategies must evolve to focus not just on blocking threats, but also on detecting abnormal behavior within trusted environments.

Conclusion

The GoGra malware is a powerful example of how cyber threats are becoming more sophisticated and stealthy. Its use of the Microsoft Graph API for communication allows it to bypass traditional detection mechanisms and operate within trusted cloud environments.

For organizations, this serves as a wake-up call. Security is no longer just about blocking external threats—it’s about understanding how attackers exploit legitimate systems.

As cyber threats continue to evolve, staying informed and adopting proactive security measures will be essential to defending against advanced malware like GoGra.

Building a 3D Galaxy Star Field with Code: A Complete Guide

  Building a 3D Galaxy Star Field with Code: A Complete Guide Creating a 3D galaxy star field is one of the most visually rewarding project...