Is adding a prefix to an API token lowering it’s security

When creating API tokens, one can pick any format one likes. Many people choose to use SHA1/SHA256 of random bytes or just random characters.

I’m wondering how much of a security issue is to prefix the API key with a prefix “leaking” it’s use-case?

E.g. if I were to use SHA1 tokens I could do:

'myproj-refresh-'+sha1(random_bytes()). So that the resulting token will be myproj-refresh-123456789321654987abcd.

This allows me to

  1. detect the API key in code (and invalidate it)
  2. minimize the number of false-positives of such token

What I’m worried about is that if it leaks, it’s not just a random number, that can be anything, but rather a thing that has an obvious meaning. It’s a refresh token for “my project”.

Do you think it’s a viable trade-off or should it be prevented?

Complexity of Rearranging a Prefix Tree/Alternative Data Structures

Let $ S$ be a subset of $ [0,1]^l$ . Is there some data structure that can represent $ S$ and can perform the following operations/queries efficiently*?

  1. $ ADD(s \in [0,1]^l)$ – operation which updates $ S$ to become $ S\cup \{s\}$
  2. $ REMOVE(s \in [0,1]^l)$ – operation which updates $ S$ to become $ S \setminus \{s\}$
  3. $ PERMUTE(\sigma)$ – operation which updates $ S$ to become $ \{\sigma(s) : s \in S\}$ , where sigma is a permutation of $ s$ , which rearranged its indices/letters according to a bijection
  4. $ START(t \in [0,1]^k)$ – query which returns whether or not there is a string $ s \in S$ whose first $ k$ letters are the same as $ t$

*By efficiently, I mean that it can perform each of the above with worst case complexity $ c^{o(l)}$ . In other words, I am fine with complexity that is exponential, but I want the exponent to be sublinear in $ l$ .

A simple prefix tree can do 1, 2, and 4 all linear in $ l$ , but I can’t fathom that it can efficiently do 3. However, if you needed to only support 4 for substrings up to length $ k$ , we could keep track of how are indices have been permuted since the beginning, and just have $ k!\binom{l}{k}$ prefix-trees for each way that could start, which would make 3 and 4 linear, and 1 and 2 $ O(l^k)$ . This gets “efficient” solutions when when $ k$ is constant, but anything that is efficient for $ k=log(l)$ or some other function of $ l$ would be quite interesting.

Pushdown Automaton to accept all strings such that no prefix has more 1’s than 0’s

Design a Pushdown Automata, accepting either by final state or by empty stack to accept the set of all strings of 0’s and 1’s such that no prefix has more 1’s than 0’s

This is a homework question, but not graded.

I’m not looking for the answer, right now I’m just trying to understand the question. I don’t understand what sort of words would be accepted and what would be rejected. For example, I can’t understand whether the following word would be accepted:

011011 ; where 01 is prefix and 1011 is suffix
011011 ; where 011 is prefix and 011 is suffix
011011 ; where 0110 is prefix and 11 is suffix

I guess my question is this: Given a word, how do I know which part is the prefix? I don’t think I can proceed with the question unless this part is clear.

Please try to give an explanation without the actual PDA answer, I’d like to try it myself first.

Thanks!

Can Someone help me load 32wine prefix to play safe harbor games in wine on any browser besides safari?

Hello I’m trying to find a way to use Firefox or any other windows browser to play on safeharborgames.net (spades) . is there anyone up for the challenge Ive been at it for a couple weeks now … only think i can get to work is safari, here is what the site has to say about using Linux for the games client .

https://www.safeharborgames.net/downloads/aboutwine.php

Ive been using wine tricks q4wine all with no luck I personally would rather stay with Firefox just to keep thing s on the same browser window enjoy a few games in between some work.

xampp prefix key_buffer is error-prone and can break in the future

Hello There Hope you all will be good.

I am facing an issue related to xampp server at my windows 10 machine which is

Upto yesterday xampp was working fine.But i don’t know has stop working when i run xampp_start.exe it throws this error I have search a lot at google and stack overflow as well but could not find any solution please help me Thanks a lot

Issue

Blockquote XAMPP now starts as a console application.

Instead of pressing Control-C in this console window, please use xampp_stop.exe to stop XAMPP, because it lets XAMPP end any current transactions and cleanup gracefully.

2019-07-24 13:55:40 11904 [Note] Using unique option prefix ‘key_buffer’ is error-prone and can break in the future. Please use the full name ‘key_buffer_size’ instead. 2019-07-24 13:55:40 11904 [Note] mysql\bin\mysqld.exe (mysqld 10.1.34-MariaDB) starting as process 13116 … (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address [::]:80 AH00451: no listening sockets available, shutting down AH00015: Unable to open logs

“Base table or view not found” in Data Migration Tool PostProcessing Step – Prefix Missing

I am migrating a Magento EE 1.14.4.2 to Magento Commerce 2.3.2 using the Data Migration Tool 2.3.2. It appears to be processing correctly until it fails about 50 minutes later on the PostProcessing step with the following error…

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘magento2.catalog_product_entity_int’ doesn’t exist, query was: DELETE FROM catalog_product_entity_int WHERE (value_id IN (‘535690′,’545428′,’546868′,’551863′,’551890′,’551899′,’551908′,’551926’, …

The source database has no table prefix and the destination database has a table prefix which are both declared as such in the config.xml (user, password and crypt keys have been removed and db names and prefix tweaked here for security)

vendor/magento/data-migration-tool/etc/commerce-to-commerce/1.14.4.2/config.xml

<?xml version="1.0" encoding="UTF-8"?> <!-- /**  * Copyright © Magento, Inc. All rights reserved.  * See COPYING.txt for license details.  */ --> <config xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../../config.xsd">     <steps mode="settings">         <step title="Settings Step">             <integrity>Migration\Step\Settings\Integrity</integrity>             <data>Migration\Step\Settings\Data</data>         </step>         <step title="Stores Step">             <integrity>Migration\Step\Stores\Integrity</integrity>             <data>Migration\Step\Stores\Data</data>             <volume>Migration\Step\Stores\Volume</volume>         </step>     </steps>     <steps mode="data">         <step title="Data Integrity Step">             <integrity>Migration\Step\DataIntegrity\Integrity</integrity>         </step>         <step title="EAV Step">             <integrity>Migration\Step\Eav\Integrity</integrity>             <data>Migration\Step\Eav\Data</data>             <volume>Migration\Step\Eav\Volume</volume>         </step>         <step title="Custom Customer Attributes Step">             <integrity>Migration\Step\CustomCustomerAttributes\Integrity</integrity>             <data>Migration\Step\CustomCustomerAttributes\Data</data>             <volume>Migration\Step\CustomCustomerAttributes\Volume</volume>         </step>         <step title="Customer Attributes Step">             <integrity>Migration\Step\Customer\Integrity</integrity>             <data>Migration\Step\Customer\Data</data>             <volume>Migration\Step\Customer\Volume</volume>         </step>         <step title="Map Step">             <integrity>Migration\Step\Map\Integrity</integrity>             <data>Migration\Step\Map\Data</data>             <volume>Migration\Step\Map\Volume</volume>         </step>         <step title="Url Rewrite Step">             <integrity>Migration\Step\UrlRewrite\Version11410to2000</integrity>             <data>Migration\Step\UrlRewrite\Version11410to2000</data>             <volume>Migration\Step\UrlRewrite\Version11410to2000</volume>         </step>         <step title="Log Step">             <integrity>Migration\Step\Log\Integrity</integrity>             <data>Migration\Step\Log\Data</data>             <volume>Migration\Step\Log\Volume</volume>         </step>         <step title="Ratings Step">             <integrity>Migration\Step\Ratings\Integrity</integrity>             <data>Migration\Step\Ratings\Data</data>             <volume>Migration\Step\Ratings\Volume</volume>         </step>         <step title="SalesOrder Step">             <integrity>Migration\Step\SalesOrder\Integrity</integrity>             <data>Migration\Step\SalesOrder\Data</data>             <volume>Migration\Step\SalesOrder\Volume</volume>         </step>         <step title="ConfigurablePrices step">             <integrity>Migration\Step\ConfigurablePrices\Integrity</integrity>             <data>Migration\Step\ConfigurablePrices\Data</data>             <volume>Migration\Step\ConfigurablePrices\Volume</volume>         </step>         <step title="OrderGrids Step">             <integrity>Migration\Step\OrderGridsEE\Integrity</integrity>             <data>Migration\Step\OrderGridsEE\Data</data>             <volume>Migration\Step\OrderGridsEE\Volume</volume>         </step>         <step title="Tier Price Step">             <integrity>Migration\Step\TierPrice\Integrity</integrity>             <data>Migration\Step\TierPrice\Data</data>             <volume>Migration\Step\TierPrice\Volume</volume>         </step>         <step title="SalesIncrement Step">             <integrity>Migration\Step\SalesIncrement\Integrity</integrity>             <data>Migration\Step\SalesIncrement\Data</data>             <volume>Migration\Step\SalesIncrement\Volume</volume>         </step>         <step title="Inventory Step">             <integrity>Migration\Step\Inventory\Integrity</integrity>             <data>Migration\Step\Inventory\Data</data>             <volume>Migration\Step\Inventory\Volume</volume>         </step>         <step title="VisualMerchandiser Step">             <integrity>Migration\Step\VisualMerchandiser\Integrity</integrity>             <data>Migration\Step\VisualMerchandiser\Data</data>             <volume>Migration\Step\VisualMerchandiser\Volume</volume>         </step>         <step title="PostProcessing Step">             <data>Migration\Step\PostProcessing\Data</data>         </step>     </steps>     <steps mode="delta">         <step title="Custom Customer Attributes Step">             <delta>Migration\Step\CustomCustomerAttributes\Delta</delta>             <volume>Migration\Step\CustomCustomerAttributes\Volume</volume>         </step>         <step title="Customer Attributes Step">             <delta>Migration\Step\Customer\Delta</delta>             <volume>Migration\Step\Customer\Volume</volume>         </step>         <step title="Map Step">             <delta>Migration\Step\Map\Delta</delta>             <volume>Migration\Step\Map\Volume</volume>         </step>         <step title="Log Step">             <delta>Migration\Step\Log\Delta</delta>             <volume>Migration\Step\Log\Volume</volume>         </step>         <step title="SalesOrder Step">             <delta>Migration\Step\SalesOrder\Delta</delta>             <volume>Migration\Step\SalesOrder\Volume</volume>         </step>         <step title="OrderGrids Step">             <delta>Migration\Step\OrderGridsEE\Delta</delta>             <volume>Migration\Step\OrderGridsEE\Volume</volume>         </step>         <step title="SalesIncrement Step">             <delta>Migration\Step\SalesIncrement\Delta</delta>             <volume>Migration\Step\SalesIncrement\Volume</volume>         </step>         <step title="Inventory Step">             <delta>Migration\Step\Inventory\Delta</delta>             <volume>Migration\Step\Inventory\Volume</volume>         </step>     </steps>     <source>         <database host="localhost" name="magento1" user="my_user" password="my_password" />     </source>     <destination>         <database host="localhost" name="magento2" user="my_user" password="my_password" />     </destination>     <options>         <map_file>etc/commerce-to-commerce/1.14.4.2/map.xml</map_file>         <eav_map_file>etc/commerce-to-commerce/map-eav.xml.dist</eav_map_file>         <eav_document_groups_file>etc/commerce-to-commerce/eav-document-groups.xml.dist</eav_document_groups_file>         <eav_attribute_groups_file>etc/commerce-to-commerce/eav-attribute-groups.xml</eav_attribute_groups_file>         <log_map_file>etc/commerce-to-commerce/map-log.xml.dist</log_map_file>         <log_document_groups_file>etc/commerce-to-commerce/log-document-groups.xml.dist</log_document_groups_file>         <settings_map_file>etc/commerce-to-commerce/settings.xml.dist</settings_map_file>         <customer_map_file>etc/commerce-to-commerce/map-customer.xml.dist</customer_map_file>         <customer_document_groups_file>etc/commerce-to-commerce/customer-document-groups.xml.dist</customer_document_groups_file>         <customer_attribute_groups_file>etc/commerce-to-commerce/customer-attribute-groups.xml.dist</customer_attribute_groups_file>         <sales_order_map_file>etc/commerce-to-commerce/map-sales.xml.dist</sales_order_map_file>         <delta_document_groups_file>etc/commerce-to-commerce/deltalog.xml.dist</delta_document_groups_file>         <customer_attr_map_file>etc/commerce-to-commerce/customer-attr-map.xml.dist</customer_attr_map_file>         <customer_attr_document_groups_file>etc/commerce-to-commerce/customer-attr-document-groups.xml.dist</customer_attr_document_groups_file>         <order_grids_document_groups_file>etc/commerce-to-commerce/order-grids-document-groups.xml.dist</order_grids_document_groups_file>         <class_map>etc/commerce-to-commerce/class-map.xml.dist</class_map>         <visual_merchandiser_map>etc/commerce-to-commerce/visual_merchandiser_map.xml.dist</visual_merchandiser_map>         <visual_merchandiser_document_groups>etc/commerce-to-commerce/visual_merchandiser_document_groups.xml.dist</visual_merchandiser_document_groups>         <visual_merchandiser_attribute_groups>etc/commerce-to-commerce/visual_merchandiser_attribute_groups.xml.dist</visual_merchandiser_attribute_groups>         <map_document_groups>etc/commerce-to-commerce/map-document-groups.xml.dist</map_document_groups>         <tier_price_map_file>etc/commerce-to-commerce/1.14.4.2/map-tier-price.xml.dist</tier_price_map_file>         <stores_map_file>etc/commerce-to-commerce/map-stores.xml.dist</stores_map_file>         <!--         In case bulk_size=0 it will be auto-detected for every document.         -->         <bulk_size>100</bulk_size>         <!--         Set direct_document_copy = 1 for better performance.         NOTE: 'source' and 'destination' databases MUST be placed on the same MySQL instance         and 'destination' user MUST be granted with 'SELECT' permissions on 'source' database          -->         <direct_document_copy>1</direct_document_copy>         <source_prefix />         <dest_prefix>abc123_</dest_prefix>         <auto_resolve_urlrewrite_duplicates>1</auto_resolve_urlrewrite_duplicates>         <log_file>migration.log</log_file>         <progress_bar_format>%percent%% [%bar%] Remaining Time: %remaining%</progress_bar_format>         <upgrade_customer_password_hash>1</upgrade_customer_password_hash>         <edition_migrate>commerce-to-commerce</edition_migrate>         <edition_number>1.14.4.2</edition_number>         <init_statements_source>SET NAMES utf8;</init_statements_source>         <init_statements_destination>SET NAMES utf8;</init_statements_destination>         <crypt_key>REMOVED</crypt_key>     </options> </config> 

It appears that the data migration tool is trying to delete records from that table without using the proper prefix for the destination site. Am I missing a setting here or is this some kind of bug?

R plot text: How to add regular text prefix to polynomial rendered in exponent form (not ^)

I’m trying to add this text to a plot: “Model: y = 1 + 2x – 3x^2 + 4x^3” where actual exponents are rendered as such (no ^ chars). (See screenshot)

Below is repro code. The first text() call works fine (no prepended regular text), but the second does not (with prepended text). (Execute soTest() to repro.)

Any suggestions? I guess I don’t know which R keywords to search for to find a solution. Any help would be appreciated! (Please pardon the camel-casing, I’m writing a slide deck for an audience with at least a few non-R coders.)

evalPoly = function( x, coeff ) {     if ( length( coeff ) < 1 ) return( c(0) )        termSum <- 0     for ( i in 1:length(coeff) ) {         termSum <- termSum + coeff[i] * x^(i-1)     }     return( termSum ) }  soTest <- function() {     coeff <- c( 1, 2, -3, 4 )     x <- 1:8     y <- evalPoly( x, coeff )     plot( x, y )     text( 2, 1600, parse( text="1+2*x-3*x^2+4*x^3" ), adj=0 )     text( 2, 1400, parse( text="Model:  y = 1+2*x-3*x^2+4*x^3" ), adj=0 ) } 

resulting plot