linux – How safe is dm-crypt/LUKS? Would TPM make me more secure in this case?

I’ve been looking to purchase a new laptop and I need to have security in mind. I’ve specifically been looking for laptops with discrete or integrated TPM because it’s been my understanding that TPM would improve disk encryption security, but after doing some more research I’ve heard a lot of sources saying that it doesn’t really make a difference and some go so far as to suggest TPM has unpatched vulnerabilities and may even be backdoored by intelligence agencies such as the NSA.

For someone such as myself who is becoming more active in activism and investigative journalism, should I bother with TPM? And how safe is dm-crypt/LUKS? I currently use Linux Mint which I believe uses LUKS by default for disk encryption and I’m wondering how vulnerable it is to attackers with physical access to my laptop.

(P.S I’ve heard of Qubes but at the moment I’m unable to use it. In my case I’ll be using Linux Mint + AppArmor and sometimes Whonix when appropriate.)

Is there a way to express arguments for a use case?

You don’t express that information in a Use Case diagram.

Martin Fowler has a good take on the UML Use Case diagram:

Use cases appear in the UML in the form of use case diagrams, but
these diagrams are of little value – the key value of use cases lies
in the text which is not standardized in UML. So when you do use cases
put your energy into the text.

That doesn’t mean that Use Case diagrams aren’t valuable. They can provide a high-level overview of the use cases and their relationships.

In addition to the Use Case diagram, consider a tabular method for capturing use cases. There are a number of different formats that can be used – searching for “use case format” turn up a lot of options.

robots.txt query string disallow except one case

I can’t find solution for my task.

For example, I have 2 pages: «/» and «/some-category/». Both of them have GET parameters: «page» and several filters.

I need the result: «/», «/?page=x», «/some-category/» — allowed; «/?page=x&», «/some-category/?» — disallowed.

I found this: «Disallow: /*?*». It prevents crawling for any query strings on the website, and it’s good, but what should I supplement to get the desired result?

fallback – Best guidance for allowing users to connect via HTTP in case of a certificate error

I’ve coded my app to use https, but if a https transaction fails for any reason, I assume it’s because the server isn’t configured for https, and thereafter start all transactions with http. Seems like that’s a vulnerability. Likewise, a script kiddie using a proxy to intercept the traffic on his client hardware would be able to make all https transactions fail.

I’m told that if someone tries to MITM your app’s HTTPS request then the request should fail (invalid certificate) and your app should fail with an error, not fallback to HTTP. In a world where SSL is reliably available, sure, but maintaining valid SSL certs is a task in itself. For example, letsencrypt recently revoked some of their certificates and forced renewal of same because of some security problem. Aside from revocations, certs are short term and have to be renewed, and the renewal process involves a lot of stitchware, and can fail. If SSL goes down, I don’t want my site to go dark.

What is the best guidance for either:

  1. More reliably maintaining certificates (such that if they do fail, the resulting downtime falls within the “five nines” SLA unavailability window) without it being such a manual headache, or

  2. Allowing the site to continue to work if SSL has failed? Is it easy to allow most activity to proceed using http, but allow known-critical transactions to require https.

Note that no browsers are involved in the scenarios that concern me.

java – Use Case Diagram for Vending machine

I want to create a use case diagram for a vending machine which has the following states:

Accepts coins of 1,5,10,25 Cents
Allow user to select products Coke(25), Pepsi(35), Soda(45)
Allow user to take refund by canceling the request.
Return selected product and remaining change if any
Allow reset operation for vending machine supplier.
Its my first time that i try to create a use case diagram and i tried to implement that
enter image description here

Its the first time that im trying to create a uml. Can anyone help me to create it?

Clean Architecture use case testing

Use case interactors in the Clean Architecture consists of the application specific business rules.

Clean Architecture diagram

Interactors uses the Data Access Interface to fetch the required data from the data access layer.
Basically I see two approaches to test these interactors.

  • Using test doubles rather than the actual data access layer
  • Using the real data access layer (e.g. sql database, webservice)

I personally prefer the first approach and test the data access layer seperately.
The interactor tests uses the Data Access Interface with the test doubles and the entities in the inner circle.
An architectural boundary is crossed in both approaches.

Is the first test approach considered as Integration Testing with a narrower scope or is it just Unit Testing?

java – How can we extend a packet in the case of an overflow?

I have asked this question in stackOverflow, but I guess that maybe softwareEngineering is more appropriate. (here is the question in stackOverflow)

I have frames sized with a fixed size of 7 values (t_i, i in {1..7}). Each value is stored on 2 bytes (the max value is then = 2^(16) -1 = 65 535) and is divided by a resolution factor of 10000, which makes 6.5535ms as the maximum value (0xFFFF). Beyond those values, the 2 bytes are no longer enough and the counter overflows.

In my test cases, I often encounter overflow especially when I use quite low frequencies

eg: frequency = 400Hz and t_1 = 1ms => t_7 = 1 + 6 * 1/400 = 16 ms > 6.5535 ms

To handle this overflow, what has been done until now was that that we allowed the overflow as it was detectable during the decoding.

To detect this overflow, the time delta between 2 consecutive (t_i) has been calculated to see if the result was lower than the max value (0xFFFF equivalent to 6.5535 ms) in which case, there is an overflow (counter and growing by definition, a decay shows an anomaly ).

I am thinking about extending the frame (x2) in case of overflow. How can I proceed to do so?

Existing lines to bypass the counter’s overflow problem :

    if (timeCounterInMs > 2000000000) { // 2000000000 is the value to be substracted to  the counter to transform long into double
                timeCounterInMs -= 2000000000;
                isCounterOverFlow = true;
    } else {
                isCounterOverFlow = false;

     currentIndexInBytes += 4;
     body(index++) = timeCounterInMs; // body of the frame
     for (int j = 0; j < 7; j++) { 
                long timeInTimeRatio = /*transform bytes to long*/;

                currentIndexInBytes += 2;
                body(index++) = timeInTimeRatio; 

                if (timeInTimeRatio == 0 && j != 0) {
                    // the end of the packet
                } else {
                    if (timeInTimeRatio <= theLastValueInPacket && j != 0) { // If the time counter declay => overflow and start to zero

                        timeInTimeRatio = timeInTimeRatio + 65536; // 0xFFFF = 65536

Thank you so much

postgresql – CASE WITH NEW. AND OLD

New problem. from : this task

NEED to do 4 state CASE with using OLD. and NEW. value
There is problem with update

        WHEN OLD.nr_w <> NEW.nr_w  AND NEW.nr_w <> '0' THEN 
            UPDATE TABLE SET "status" = 'ON<>N<>' WHERE TABLE."id" = ;
        WHEN OLD.nr_w <> NEW.nr_w  AND NEW.nr_w = '0' THEN 
            UPDATE TABLE SET "status" = 'ON<>N=' WHERE TABLE."id" = ;
        WHEN OLD.nr_w = NEW.nr_w  AND NEW.nr_w <> '0' THEN 
            UPDATE TABLE SET "status" = 'ON=N<>' WHERE TABLE."id" = ;
        WHEN OLD.nr_w = NEW.nr_w  AND NEW.nr_w = '0' THEN 
            UPDATE TABLE SET "status" = 'ON=N=' WHERE TABLE."id" = ;

postgresql – Trigger TG_OP Status CASE

Im new and was using this forum since one mounth. Its very usefull. Sorry for my english.

I have a problem. Made a Trigger with function. Im using TG_OP State. I need to do CASE under CASE, IF working... but case is beher how to use it ? i dont whant to paste all code becouse it`s over 200 lines 🙂

  CREATE OR REPLACE FUNCTION public.raport_pge()
    RETURNS trigger AS
    //-> HERE I NEED TO DO CASE IT` S NOT WORKING HERE IT`s importent for me watch one value (x) if sb, change it must do many things.
       WHEN OLD.x ='0' AND NEW.x ='0' THEN   UPDATE.....; UPDATE ;
        UPDATE .... ; 
        IF .... THEN 
     END IF;
       END CASE;
  LANGUAGE plpgsql 

customs and immigration – Practical implication of Judgment in Case C-754/18 to family members of EU citizens according to EU 2004/38/EC

CJEU recently made a Judgment in Case C-754/18.

What practical implications it may have to family members of EU citizens according to EU 2004/38/EC.

The first point made by CJEU is that a permanent residence card according to Article 20 is at least equivalent to residence card according to Article 10.

Honestly, to claim otherwise is very stupid and I remember that European Commision already said it years before. Finally, there is a final argument to this topic.

The second point, for me much more interesting, is that CJEU decided that once a status as a family member of EU citizen according to EU 2004/38/EC is proven in one member state then a border guard is not allowed to question the status (unless there is an misuse or fraud).

From my experience, the police is very restrictive regarding Article 3/1 Beneficiaries of EU 2004/38/EC “a family member who is accompanying or joining the EU citizen”.

Firstly, the police does not even know the EU law. Then, they demand an absolute proof of accompanying or joining according to Article 3/1.

Do I understand that this police practise is over? The CJEU said clearly that a residence card according to Article 10 or 20 proves the status and police cannot further question it.

I am currently forcing criminal charges against German police as they completely failed to recognise my wife as a family member of EU citizen according to EU 2004/38/EC making all kind of stupid excuses. My wife clearly identified herself with residence cards according to Article 10 and 20.

What is your experience?