ZTX's Blog


  • Home

  • Tags

  • Categories

  • Archives

  • chinese

  • Search

What is The Cuckoo Attack

Posted on 2020-06-24 | In Security , TEE , Attacks | | Visitors:

Introduction

The cuckoo bird replaces other birds’ eggs with its own. The victim birds are tricked into feeding the cuckoo chick as if it were their own.Similarly, in a cuckoo attack, the attacker “replaces” the victim’s TEE with his own TEE, leading the victim to treat the attacker’s TEE as his own.
test CI/CD

Read more »

Google Kick Start 2018 Round A: Even Digits

Posted on 2019-11-01 | In Coding , Python | | Visitors:

Google Kick Start 2018 Round A: Even Digits

Problem

Supervin has a unique calculator. This calculator only has a display, a plus button, and a minus button. Currently, the integer N is displayed on the calculator display.

Pressing the plus button increases the current number displayed on the calculator display by 1. Similarly, pressing the minus button decreases the current number displayed on the calculator display by 1. The calculator does not display any leading zeros. For example, if 100 is displayed on the calculator display, pressing the minus button once will cause the calculator to display 99.

Supervin does not like odd digits, because he thinks they are “odd”. Therefore, he wants to display an integer with only even digits in its decimal representation, using only the calculator buttons. Since the calculator is a bit old and the buttons are hard to press, he wants to use a minimal number of button presses.

Please help Supervin to determine the minimum number of button presses to make the calculator display an integer with no odd digits.

Read more »

Producer-consumer problem solution in C

Posted on 2019-10-21 | In Coding , C/C++ | | Visitors:

Producer-consumer problem multiprocessing solution in C with details

Problem

Producer-consumer problem is a classical problem in concurrency programming, I want to solve it by multiprocessing method. Multiprocessing method need more knowledges than multithreading method, because different process need to communicate with each other.

Process can communicate with each other by IPC (Inter-Process Communication), I chose a type of IPC , share memory, to implement.

Read more »

leetcode 1114 Print in Order, sample concurrency in Python

Posted on 2019-10-21 | In Coding , Python | | Visitors:

leetcode 1114 Print in Order, sample concurrency in Python

Problem

Suppose we have a class:

1
2
3
4
5
public class Foo {
public void first() { print("first"); }
public void second() { print("second"); }
public void third() { print("third"); }
}

The same instance of Foo will be passed to three different threads. Thread A will call first(), thread B will call second(), and thread C will call third(). Design a mechanism and modify the program to ensure that second() is executed after first(), and third() is executed after second().

Read more »
Attacks C Google Kick Start Producer-consumer problem Python TEE concurrency multiprocessing multithreading

Zhang Tianxu

Zhang Tianxu

I am like a cat, but I like dogs.

4 posts
6 categories
9 tags
E-Mail StackOverflow
© 2018 — 2021 Zhang Tianxu
Hosted by GitHub Pages