macOS Forensis – Analyze file timestamps in deep

In digital forensics, analyzing timestamps can provide valuable insights into the timeline of events and help reconstruct a digital crime scene. This article focuses on macOS forensics and delves into the analysis of timestamps using a real-world example.

By examining the metadata of a file, specifically the “icon.png.webp” file, we will explore various timestamps and their significance in forensic investigations.


Example

Let’s start by analyzing the metadata of the “icon.png.webp” file using the “mdls” command in macOS, generally located in /usr/bin/mdls.

Read More
 

File Encryption and Decryption in Swift using AES Algorithm

Data security is of utmost importance when dealing with sensitive information. Encryption plays a vital role in safeguarding data from unauthorized access. In this technical blog, we will explore how to encrypt and decrypt files in Swift using the Advanced Encryption Standard (AES) algorithm. We will provide a Swift implementation that demonstrates the encryption and decryption process using a symmetric key.


Final project

This tutorial allow you to create a simple macOS status bar application (with registered file handle: “Open with…”) for crypt and encrypt file, instantly and easily:


AES Encryption and Decryption:

AES is a widely used encryption algorithm that provides a strong level of security. It operates on fixed-size blocks of data and supports key sizes of 128, 192, and 256 bits. AES uses symmetric encryption, meaning the same key is used for both encryption and decryption.

Read More
 

iOS – Secure app sensitive information

Today I want to share a fresh new Swift Package SDK that helps you to hide sensitive informations on your app, like banking apps, in a easy way!

You’ll be notified via callback (optional) when a defined rule occur, and apply the right custom protection you prefer or simply use the integrated blur that cover your app automatically.


Available protections

While writing this post, the SDK provide these protections callbacks:

Read More
 

Arduino – Room Spy Email Notificator

Hi nerdz,
today i’ll show you how to easily control remotely your room with a stupid motion detector, a piro sensor (or you can use other sensors, like ultrasonicinfraredlight sensorpressure, etc etc…) and two lines of PHP code and C.

* Useful if you want to know if anyone enter in your room and the time that remains there! *

You can get this sensor from AirWick deo! 😎

How it works?


Your piro sensor, when detect a motion, notify arduino, that was programmed to send to serial port a value (“m” or “n”).
These value are interpreted by a serial reader (c# program, objective-c, java, c++, or somethig else) that call a PHP page that send email if is enabled sending mode.
Second php page, permit you to control arduino (enable/disable/show logs/clear all).

Steps

Connect your piro sensor to arduino, easy way, like this:

After that, write your simple arduino code:

/*
 * Room Spy with Piro sensor
 * (c)2012 - Alberto Pasca
 * www.albertopasca.it
 */
 
int inputPin = 2;    // choose the input pin (for PIR sensor)
int pirState = LOW;  // we start, assuming no motion detected
int val = 0;         // variable for reading the pin status
 
void setup() {
  pinMode(inputPin, INPUT);     // declare sensor as input
  Serial.begin(9600);
}
 
void loop(){
  val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    if (pirState == LOW) {      // MOTION START
      Serial.println("m");
      pirState = HIGH;
    }
  } else {
    if (pirState == HIGH) {     // MOTION STOP
      Serial.println("n");
      pirState = LOW;
    }
  }
}

Well, test your code, Arduino can able to send to serial “m” or “n”. If do this, you’re ok!


Now write a serial reader (read these (p1 || p2) old post to know how) and call your php page.
Here C# snippet:

try {
  SerialPort port = new SerialPort( "COM9", 9600, Parity.None, 8, StopBits.One );
  port.Open();
  string data = string.empty;
  while ( true ) {
    data = port.ReadLine();
  }
} catch ( Exception ee ) { Console.WriteLine( ee.Message ); }

My Serial Reader, write this output (“ok” or “ko”, based on php output):

Now, i create a control page, that do this simple things.
If enable, write to roomcmd.dat “1″ value, else write “0″. Log and Clear read or clean log file.

if ( $_POST["mode"] == "enable" ) {
    $flog = fopen("roomcmd.dat", "w+"); 
    fwrite($flog, "1");
    fclose($flog);
} else if ( $_POST["mode"] == "disable" ) {
    $flog = fopen("roomcmd.dat", "w+"); 
    fwrite($flog, "0");
    fclose($flog);
} else if ( $_POST["mode"] == "log" ) {
    $msg = file_get_contents("roomspy.txt");
} else if ( $_POST["mode"] == "clear" ) {
    $flog = fopen("roomspy.txt", "w+"); 
    fwrite($flog, "");
    fclose($flog);
}

Last step, is the “mail script” (called from SerialReader), that read values from file “roomcmd.dat” that can contains “0″ or “1″. Decide to send or not notifications.

  $enable = file_get_contents("roomcmd.dat");
  if ( $enable == "1" )
  {
     $now = date("d-m-o h:i:sA");
     $msg = "[Arduino :: $now]\n";

     $flog = fopen("roomspy.txt", "a+"); 
     fwrite($flog, $msg);
     fclose($flog);

     mail("youraddress@example.com",
          "[Arduino] - Something in the way...", 
          $now, 
          "from:Arduino<no -reply@albertopasca.it>");
   echo "ok";
  }
  else echo "ko";

With these two pages, you can able to control your Serial Reader program, that is connected to Arduino and send or not email to your address.

Final circuit with piro sensor connected:

You can use a Wifi Shield or Ethernet Shield or GSM/GPRS Shield to send email.
In this example you need a powered pc connected to Arduino.

In next tutorial, we attach it on a GSM/GPRS Shield.

enjoy as usual!